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

Side by Side Diff: fpdfsdk/src/javascript/JS_Runtime.cpp

Issue 581413002: Invoke V8::Initialize() explicitly during V8 setup (Closed) Base URL: https://pdfium.googlesource.com/pdfium/@master
Patch Set: Created 6 years, 3 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 | no next file » | 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 "../../include/javascript/JavaScript.h" 7 #include "../../include/javascript/JavaScript.h"
8 #include "../../include/javascript/IJavaScript.h" 8 #include "../../include/javascript/IJavaScript.h"
9 #include "../../include/javascript/JS_EventHandler.h" 9 #include "../../include/javascript/JS_EventHandler.h"
10 #include "../../include/javascript/JS_Runtime.h" 10 #include "../../include/javascript/JS_Runtime.h"
(...skipping 22 matching lines...) Expand all
33 { 33 {
34 } 34 }
35 35
36 IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime (CPDFDoc_Environment* pApp) 36 IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime (CPDFDoc_Environment* pApp)
37 { 37 {
38 if (!m_bInit) 38 if (!m_bInit)
39 { 39 {
40 JS_Initial(); 40 JS_Initial();
41 m_platform = v8::platform::CreateDefaultPlatform(); 41 m_platform = v8::platform::CreateDefaultPlatform();
42 v8::V8::InitializePlatform(m_platform); 42 v8::V8::InitializePlatform(m_platform);
43 v8::V8::Initialize();
43 44
44 m_bInit = TRUE; 45 m_bInit = TRUE;
45 } 46 }
46 return new CJS_Runtime(pApp); 47 return new CJS_Runtime(pApp);
47 } 48 }
48 void CJS_RuntimeFactory::AddR ef() 49 void CJS_RuntimeFactory::AddR ef()
49 { 50 {
50 //to do.Should be implemented as atom manipulation. 51 //to do.Should be implemented as atom manipulation.
51 m_nRef++; 52 m_nRef++;
52 } 53 }
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 return v8::Isolate::GetCurrent() == m_isolate; 469 return v8::Isolate::GetCurrent() == m_isolate;
469 } 470 }
470 void CJS_Runtime::Exit() 471 void CJS_Runtime::Exit()
471 { 472 {
472 if(m_isolate) m_isolate->Exit(); 473 if(m_isolate) m_isolate->Exit();
473 } 474 }
474 void CJS_Runtime::Enter() 475 void CJS_Runtime::Enter()
475 { 476 {
476 if(m_isolate) m_isolate->Enter(); 477 if(m_isolate) m_isolate->Enter();
477 } 478 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698