Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: xfa/fxjse/runtime.cpp

Issue 2026933002: Remove use of v8:Lockers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/js_embedder_test.cpp ('k') | xfa/fxjse/scope_inline.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fxjse/runtime.h" 7 #include "xfa/fxjse/runtime.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 static FX_BOOL bV8Initialized = FALSE; 30 static FX_BOOL bV8Initialized = FALSE;
31 if (bV8Initialized) { 31 if (bV8Initialized) {
32 return; 32 return;
33 } 33 }
34 bV8Initialized = TRUE; 34 bV8Initialized = TRUE;
35 atexit(FXJSE_KillV8); 35 atexit(FXJSE_KillV8);
36 } 36 }
37 37
38 static void FXJSE_Runtime_DisposeCallback(v8::Isolate* pIsolate) { 38 static void FXJSE_Runtime_DisposeCallback(v8::Isolate* pIsolate) {
39 { 39 if (FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(pIsolate)) {
40 v8::Locker locker(pIsolate); 40 delete pData->m_pFXJSERuntimeData;
41 if (FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(pIsolate)) { 41 pData->m_pFXJSERuntimeData = nullptr;
42 delete pData->m_pFXJSERuntimeData;
43 pData->m_pFXJSERuntimeData = nullptr;
44 }
45 } 42 }
46 pIsolate->Dispose(); 43 pIsolate->Dispose();
47 } 44 }
48 45
49 void FXJSE_Finalize() { 46 void FXJSE_Finalize() {
50 if (CFXJSE_RuntimeData::g_RuntimeList) { 47 if (CFXJSE_RuntimeData::g_RuntimeList) {
51 CFXJSE_RuntimeData::g_RuntimeList->RemoveAllRuntimes( 48 CFXJSE_RuntimeData::g_RuntimeList->RemoveAllRuntimes(
52 FXJSE_Runtime_DisposeCallback); 49 FXJSE_Runtime_DisposeCallback);
53 delete CFXJSE_RuntimeData::g_RuntimeList; 50 delete CFXJSE_RuntimeData::g_RuntimeList;
54 CFXJSE_RuntimeData::g_RuntimeList = NULL; 51 CFXJSE_RuntimeData::g_RuntimeList = NULL;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 114 }
118 115
119 void CFXJSE_RuntimeList::RemoveAllRuntimes( 116 void CFXJSE_RuntimeList::RemoveAllRuntimes(
120 CFXJSE_RuntimeList::RuntimeDisposeCallback lpfnDisposeCallback) { 117 CFXJSE_RuntimeList::RuntimeDisposeCallback lpfnDisposeCallback) {
121 if (lpfnDisposeCallback) { 118 if (lpfnDisposeCallback) {
122 for (v8::Isolate* pIsolate : m_RuntimeList) 119 for (v8::Isolate* pIsolate : m_RuntimeList)
123 lpfnDisposeCallback(pIsolate); 120 lpfnDisposeCallback(pIsolate);
124 } 121 }
125 m_RuntimeList.clear(); 122 m_RuntimeList.clear();
126 } 123 }
OLDNEW
« no previous file with comments | « testing/js_embedder_test.cpp ('k') | xfa/fxjse/scope_inline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698