diff options
author | John Abd-El-Malek <jabdelmalek@google.com> | 2014-05-17 22:33:34 -0700 |
---|---|---|
committer | John Abd-El-Malek <jabdelmalek@google.com> | 2014-05-17 22:33:34 -0700 |
commit | 5110c4743751145c4ae1934cd1d83bc6c55bb43f (patch) | |
tree | b141608096b73163182764c25b895d3df4b2c182 /fpdfsdk/src/fpdfoom.cpp | |
parent | 76b563d2feed92ed328afb1f15e3466a9536b11b (diff) | |
download | pdfium-5110c4743751145c4ae1934cd1d83bc6c55bb43f.tar.xz |
Initial commit.
Diffstat (limited to 'fpdfsdk/src/fpdfoom.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfoom.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/fpdfsdk/src/fpdfoom.cpp b/fpdfsdk/src/fpdfoom.cpp new file mode 100644 index 0000000000..fb67a5a1fe --- /dev/null +++ b/fpdfsdk/src/fpdfoom.cpp @@ -0,0 +1,27 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdfoom.h"
+
+void OOM_Handler(FXMEM_FoxitMgr* pFoxitMgr, void* param)
+{
+ if (!param) return;
+ ((OOM_INFO*)param)->FSDK_OOM_Handler((OOM_INFO*)param);
+}
+
+
+DLLEXPORT FX_BOOL STDCALL FSDK_SetOOMHandler(OOM_INFO* oomInfo)
+{
+#ifndef _FXSDK_OPENSOURCE_
+ if (!oomInfo || oomInfo->version!=1)
+ return FALSE;
+ FXMEM_SetOOMHandler(FXMEM_GetDefaultMgr(),OOM_Handler,oomInfo);
+ return TRUE;
+#else
+ return TRUE;
+#endif
+}
|