Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: fpdfsdk/include/javascript/JS_Runtime.h

Issue 1118043002: Provide an array buffer allocator to V8. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Indent. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/include/javascript/JS_Runtime.h
diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/include/javascript/JS_Runtime.h
index a1f62b8d0fa175c98bd144809e3aed167e4e1e2d..5326db693dec45b3e9d22ef977d5f59c880d7d3e 100644
--- a/fpdfsdk/include/javascript/JS_Runtime.h
+++ b/fpdfsdk/include/javascript/JS_Runtime.h
@@ -7,6 +7,7 @@
#ifndef _JS_RUNTIME_H_
#define _JS_RUNTIME_H_
+#include "../../../third_party/base/nonstd_unique_ptr.h"
#include "../../../core/include/fxcrt/fx_basic.h"
#include "../jsapi/fxjs_v8.h"
#include "IJavaScript.h"
@@ -14,6 +15,12 @@
class CJS_Context;
+class CJS_ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
+ void* Allocate(size_t length) override;
+ void* AllocateUninitialized(size_t length) override;
+ void Free(void* data, size_t length) override;
+};
+
class CJS_FieldEvent
{
public:
@@ -53,15 +60,16 @@ public:
v8::Handle<v8::Context> NewJSContext();
protected:
- CFX_ArrayTemplate<CJS_Context *> m_ContextArray;
- CPDFDoc_Environment * m_pApp;
- CPDFSDK_Document * m_pDocument;
+ CFX_ArrayTemplate<CJS_Context*> m_ContextArray;
+ CPDFDoc_Environment* m_pApp;
+ CPDFSDK_Document* m_pDocument;
FX_BOOL m_bBlocking;
+ FX_BOOL m_bRegistered;
CJS_FieldEvent* m_pFieldEventPath;
- v8::Isolate* m_isolate;
- v8::Persistent<v8::Context> m_context;
- FX_BOOL m_bRegistered;
+ v8::Isolate* m_isolate;
+ nonstd::unique_ptr<CJS_ArrayBufferAllocator> m_pArrayBufferAllocator;
+ v8::Persistent<v8::Context> m_context;
};
#endif //_JS_RUNTIME_H_
« no previous file with comments | « DEPS ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698