diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-09-10 11:56:37 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-09-10 11:56:37 -0700 |
commit | 6df59849472958e7de96da6d9fc7b223b7c1f1c3 (patch) | |
tree | 90b4908f6de484252f9757010b7002c4f0365a58 /fpdfsdk/include/javascript/JS_Runtime.h | |
parent | 0d0935d3d6603dd7d851b1d5828635230f4c43ca (diff) | |
download | pdfium-6df59849472958e7de96da6d9fc7b223b7c1f1c3.tar.xz |
Remove some abstractions in fxjs_v8.h.
It's too hard to keep mapping between v8 and fx abstractions; the lack
of transparency prevents those skilled in v8 only from working on this
code.
Apparently, the original intention was to confine v8 types to
fpdfsdk/{include,src}/jsapi, but fpdfsdk/{include,src}/javascript
is already well-polluted with v8 types.
Also remove no-op JS_SetThisObj().
Also remove unused ParserParams() [noticed because it was incorrectly
passing handles as pointers].
Also remove cast operator from CJS_Runtime and call GetIsolate()
explicitly.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1332973002 .
Diffstat (limited to 'fpdfsdk/include/javascript/JS_Runtime.h')
-rw-r--r-- | fpdfsdk/include/javascript/JS_Runtime.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/include/javascript/JS_Runtime.h index 5a811fca1f..314330ca6c 100644 --- a/fpdfsdk/include/javascript/JS_Runtime.h +++ b/fpdfsdk/include/javascript/JS_Runtime.h @@ -40,7 +40,7 @@ class CJS_Runtime : public IFXJS_Runtime { void SetReaderDocument(CPDFSDK_Document* pReaderDoc) override; CPDFSDK_Document* GetReaderDocument() override { return m_pDocument; } - CPDFDoc_Environment* GetReaderApp() { return m_pApp; } + CPDFDoc_Environment* GetReaderApp() const { return m_pApp; } FX_BOOL InitJSObjects(); @@ -52,12 +52,9 @@ class CJS_Runtime : public IFXJS_Runtime { void BeginBlock() { m_bBlocking = TRUE; } void EndBlock() { m_bBlocking = FALSE; } - FX_BOOL IsBlocking() { return m_bBlocking; } - - operator IJS_Runtime*() { return (IJS_Runtime*)m_isolate; } - v8::Isolate* GetIsolate() { return m_isolate; } - void SetIsolate(v8::Isolate* isolate) { m_isolate = isolate; } + FX_BOOL IsBlocking() const { return m_bBlocking; } + v8::Isolate* GetIsolate() const { return m_isolate; } v8::Local<v8::Context> NewJSContext(); protected: @@ -66,7 +63,6 @@ class CJS_Runtime : public IFXJS_Runtime { CPDFSDK_Document* m_pDocument; FX_BOOL m_bBlocking; CJS_FieldEvent* m_pFieldEventPath; - v8::Isolate* m_isolate; bool m_isolateManaged; nonstd::unique_ptr<CJS_ArrayBufferAllocator> m_pArrayBufferAllocator; |