diff options
author | tsepez <tsepez@chromium.org> | 2016-08-15 11:40:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-15 11:40:12 -0700 |
commit | a4941914bb4411dc4e9053cb344e0349db388007 (patch) | |
tree | 5b5784812bddf80eb4a79ed2597f016f8b72d8ce /fxjs/fxjs_v8_embeddertest.cpp | |
parent | 2ba53c176df1bc5bb963901e7cc42c6a60af24eb (diff) | |
download | pdfium-a4941914bb4411dc4e9053cb344e0349db388007.tar.xz |
Move some v8 objects from CJS back into FXJS
Create a new class to hold these, CFXJS_Engine (could have been
called Runtime, but there are too many "Runtimes" already). In a
subsequent patch, all the FXJS_*() functions that take an isolate
as the first argument can become methods on the engine.
CJS_ must still manage the isolates; this happens outside
the engine.
The IJS_Runtime abstraction moves up to fpdfsdk/javascript; it
remains to allow for either a real JS library or a stubb one to
be linked (for non-js builds).
Review-Url: https://codereview.chromium.org/2241483004
Diffstat (limited to 'fxjs/fxjs_v8_embeddertest.cpp')
-rw-r--r-- | fxjs/fxjs_v8_embeddertest.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fxjs/fxjs_v8_embeddertest.cpp b/fxjs/fxjs_v8_embeddertest.cpp index 71b004c144..b573939b14 100644 --- a/fxjs/fxjs_v8_embeddertest.cpp +++ b/fxjs/fxjs_v8_embeddertest.cpp @@ -44,19 +44,17 @@ TEST_F(FXJSV8EmbedderTest, Getters) { CheckAssignmentInCurrentContext(kExpected1); } -TEST_F(FXJSV8EmbedderTest, MultipleRutimes) { +TEST_F(FXJSV8EmbedderTest, MultipleEngines) { v8::Isolate::Scope isolate_scope(isolate()); v8::HandleScope handle_scope(isolate()); v8::Global<v8::Context> global_context1; std::vector<v8::Global<v8::Object>*> static_objects1; - FXJS_InitializeRuntime(isolate(), nullptr, &global_context1, - &static_objects1); + FXJS_InitializeEngine(isolate(), nullptr, &global_context1, &static_objects1); v8::Global<v8::Context> global_context2; std::vector<v8::Global<v8::Object>*> static_objects2; - FXJS_InitializeRuntime(isolate(), nullptr, &global_context2, - &static_objects2); + FXJS_InitializeEngine(isolate(), nullptr, &global_context2, &static_objects2); v8::Context::Scope context_scope(GetV8Context()); ExecuteInCurrentContext(CFX_WideString(kScript0)); @@ -69,7 +67,7 @@ TEST_F(FXJSV8EmbedderTest, MultipleRutimes) { ExecuteInCurrentContext(CFX_WideString(kScript1)); CheckAssignmentInCurrentContext(kExpected1); } - FXJS_ReleaseRuntime(isolate(), &global_context1, &static_objects1); + FXJS_ReleaseEngine(isolate(), &global_context1, &static_objects1); { v8::Local<v8::Context> context2 = @@ -78,7 +76,7 @@ TEST_F(FXJSV8EmbedderTest, MultipleRutimes) { ExecuteInCurrentContext(CFX_WideString(kScript2)); CheckAssignmentInCurrentContext(kExpected2); } - FXJS_ReleaseRuntime(isolate(), &global_context2, &static_objects2); + FXJS_ReleaseEngine(isolate(), &global_context2, &static_objects2); CheckAssignmentInCurrentContext(kExpected0); } |