From 1258f7f21725c703269581e0241fbad86d89209c Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 2 Feb 2018 17:37:37 +0000 Subject: 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 Commit-Queue: Tom Sepez --- fxjs/fxjs_v8.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fxjs/fxjs_v8.cpp') diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp index e73ab0a8f0..4c9c5602d2 100644 --- a/fxjs/fxjs_v8.cpp +++ b/fxjs/fxjs_v8.cpp @@ -423,13 +423,13 @@ void CFXJS_Engine::InitializeEngine() { } } } - ResetPersistentContext(v8Context); + m_V8Context.Reset(GetIsolate(), v8Context); } void CFXJS_Engine::ReleaseEngine() { v8::Isolate::Scope isolate_scope(GetIsolate()); v8::HandleScope handle_scope(GetIsolate()); - v8::Local context = NewLocalContext(); + v8::Local context = GetV8Context(); v8::Context::Scope context_scope(context); FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(GetIsolate()); if (!pData) @@ -457,7 +457,7 @@ void CFXJS_Engine::ReleaseEngine() { } } - ReleasePersistentContext(); + m_V8Context.Reset(); if (GetIsolate() == g_isolate && --g_isolate_ref_count > 0) return; -- cgit v1.2.3