diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-30 14:30:29 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-30 14:30:29 -0700 |
commit | f3fecc0c686418272e49c8d51da2cb12e80bd1a2 (patch) | |
tree | 082c6f9fbfd9d7d3f51707aaa4030e43e6c50d7d /fpdfsdk/include/javascript | |
parent | befafb6d0a6d2ae745c88193e50b631fda2c746a (diff) | |
download | pdfium-chromium/2394.tar.xz |
Provide an array buffer allocator to V8.chromium/2395chromium/2394chromium/2393chromium/2392chromium/2391chromium/2390chromium/2389chromium/2388
This allows PDFium to work with current V8, so unpin v8 in the
pdfium DEPS file.
(I also re-ordered one field in CJS_Runtime, just to put two bools
together (may pack tighter), and to put all the v8 stuff together).
BUG=pdfium:146
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1118043002
Diffstat (limited to 'fpdfsdk/include/javascript')
-rw-r--r-- | fpdfsdk/include/javascript/JS_Runtime.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/include/javascript/JS_Runtime.h index a1f62b8d0f..5326db693d 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_ |