| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |