diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-02-02 17:37:37 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-02 17:37:37 +0000 |
commit | 1258f7f21725c703269581e0241fbad86d89209c (patch) | |
tree | 4b065d6c432ee9e23995cab693a9eab73fbddfa1 /fxjs/fxjs_v8.h | |
parent | 9cbd2dd8ff0812aae57a99d6a7dc285cc8b9e262 (diff) | |
download | pdfium-1258f7f21725c703269581e0241fbad86d89209c.tar.xz |
Remove V8 context from CJS_V8
Makes CFXJS_Engine and CFXJSE_Engine consistent with each other in
that both have a V8 context to themselves, and not one inheritted
from the CJS_V8 (which is now more per-isolate than per-context).
Consolidate NewLocalContext() and GetPersistentContext(), which both
did the exact same thing under the covers once inside v8 land.
Rename a few things to make it simpler.
Change-Id: I68905db9ad44253063da235fcb276a75627a2dbc
Reviewed-on: https://pdfium-review.googlesource.com/25170
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/fxjs_v8.h')
-rw-r--r-- | fxjs/fxjs_v8.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fxjs/fxjs_v8.h b/fxjs/fxjs_v8.h index 0372ade9ce..851bdd5428 100644 --- a/fxjs/fxjs_v8.h +++ b/fxjs/fxjs_v8.h @@ -178,7 +178,6 @@ class CFXJS_Engine : public CJS_V8 { int Execute(const WideString& script, FXJSErr* perror); v8::Local<v8::Object> GetThisObj(); - v8::Local<v8::Object> NewFxDynamicObj(int nObjDefnID, bool bStatic = false); // Native object binding. @@ -189,10 +188,15 @@ class CFXJS_Engine : public CJS_V8 { void Error(const WideString& message); + v8::Local<v8::Context> GetV8Context() { + return v8::Local<v8::Context>::New(GetIsolate(), m_V8Context); + } + protected: CFXJS_Engine(); private: + v8::Global<v8::Context> m_V8Context; std::vector<v8::Global<v8::Object>*> m_StaticObjects; }; |