diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-12-04 15:42:15 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-04 15:42:15 +0000 |
commit | 53190d99102c9b3a5e0a8751e2f4f957d7736ccf (patch) | |
tree | a2709328fa393286a6c98504d5e00b949b62ad48 /fxjs/cfxjse_runtimedata.cpp | |
parent | f8f19dc2c1b66fbcc2be837c324cab3df0ff3671 (diff) | |
download | pdfium-53190d99102c9b3a5e0a8751e2f4f957d7736ccf.tar.xz |
Remove XFA isolate tracker
We don't add anything to the tracker lists so we can remove the tracker.
The only thing the Initialize and Finialize methods are doing now is to
trigger a v8::V8::Dispose which should happen automatically at exit
anyway.
Change-Id: I1f783ae5a1df3df63fb067ab30310791b6c44929
Reviewed-on: https://pdfium-review.googlesource.com/20192
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_runtimedata.cpp')
-rw-r--r-- | fxjs/cfxjse_runtimedata.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/fxjs/cfxjse_runtimedata.cpp b/fxjs/cfxjse_runtimedata.cpp index be6938e762..b5c2de9297 100644 --- a/fxjs/cfxjse_runtimedata.cpp +++ b/fxjs/cfxjse_runtimedata.cpp @@ -11,42 +11,6 @@ #include "fxjs/cfxjse_isolatetracker.h" #include "fxjs/fxjs_v8.h" -namespace { - -void Runtime_DisposeCallback(v8::Isolate* pIsolate, bool bOwned) { - if (FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(pIsolate)) - delete pData; - if (bOwned) - pIsolate->Dispose(); -} - -void KillV8() { - v8::V8::Dispose(); -} - -} // namespace - -void FXJSE_Initialize() { - if (!CFXJSE_IsolateTracker::g_pInstance) - CFXJSE_IsolateTracker::g_pInstance = new CFXJSE_IsolateTracker; - - static bool bV8Initialized = false; - if (bV8Initialized) - return; - - bV8Initialized = true; - atexit(KillV8); -} - -void FXJSE_Finalize() { - if (!CFXJSE_IsolateTracker::g_pInstance) - return; - - CFXJSE_IsolateTracker::g_pInstance->RemoveAll(Runtime_DisposeCallback); - delete CFXJSE_IsolateTracker::g_pInstance; - CFXJSE_IsolateTracker::g_pInstance = nullptr; -} - CFXJSE_RuntimeData::CFXJSE_RuntimeData(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {} @@ -84,5 +48,3 @@ CFXJSE_RuntimeData* CFXJSE_RuntimeData::Get(v8::Isolate* pIsolate) { pData->m_pFXJSERuntimeData = CFXJSE_RuntimeData::Create(pIsolate); return pData->m_pFXJSERuntimeData.get(); } - -CFXJSE_IsolateTracker* CFXJSE_IsolateTracker::g_pInstance = nullptr; |