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

Side by Side Diff: fpdfsdk/javascript/cjs_context.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 | « no previous file | fpdfsdk/javascript/cjs_runtime.cpp » ('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 "fpdfsdk/javascript/cjs_context.h" 7 #include "fpdfsdk/javascript/cjs_context.h"
8 8
9 #include "fpdfsdk/javascript/JS_EventHandler.h" 9 #include "fpdfsdk/javascript/JS_EventHandler.h"
10 #include "fpdfsdk/javascript/cjs_runtime.h" 10 #include "fpdfsdk/javascript/cjs_runtime.h"
(...skipping 12 matching lines...) Expand all
23 return m_pRuntime->GetReaderDocument(); 23 return m_pRuntime->GetReaderDocument();
24 } 24 }
25 25
26 CPDFDoc_Environment* CJS_Context::GetReaderApp() { 26 CPDFDoc_Environment* CJS_Context::GetReaderApp() {
27 return m_pRuntime->GetReaderApp(); 27 return m_pRuntime->GetReaderApp();
28 } 28 }
29 29
30 FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, 30 FX_BOOL CJS_Context::RunScript(const CFX_WideString& script,
31 CFX_WideString* info) { 31 CFX_WideString* info) {
32 v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate()); 32 v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
33 #ifdef PDF_ENABLE_XFA
34 v8::Locker locker(m_pRuntime->GetIsolate());
35 #endif // PDF_ENABLE_XFA
36 v8::HandleScope handle_scope(m_pRuntime->GetIsolate()); 33 v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
37 v8::Local<v8::Context> context = m_pRuntime->NewJSContext(); 34 v8::Local<v8::Context> context = m_pRuntime->NewJSContext();
38 v8::Context::Scope context_scope(context); 35 v8::Context::Scope context_scope(context);
39 36
40 if (m_bBusy) { 37 if (m_bBusy) {
41 *info = JSGetStringFromID(this, IDS_STRING_JSBUSY); 38 *info = JSGetStringFromID(this, IDS_STRING_JSBUSY);
42 return FALSE; 39 return FALSE;
43 } 40 }
44 m_bBusy = TRUE; 41 m_bBusy = TRUE;
45 42
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 269 }
273 270
274 void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget) { 271 void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget) {
275 m_pEventHandler->OnBatchExec(pTarget); 272 m_pEventHandler->OnBatchExec(pTarget);
276 } 273 }
277 274
278 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget, 275 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget,
279 const CFX_WideString& strTargetName) { 276 const CFX_WideString& strTargetName) {
280 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName); 277 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName);
281 } 278 }
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/javascript/cjs_runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698