| 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 17 matching lines...) Expand all  Loading... | 
| 28 #include "../../include/javascript/console.h" | 28 #include "../../include/javascript/console.h" | 
| 29 | 29 | 
| 30 CJS_RuntimeFactory::~CJS_RuntimeFactory() | 30 CJS_RuntimeFactory::~CJS_RuntimeFactory() | 
| 31 { | 31 { | 
| 32 } | 32 } | 
| 33 | 33 | 
| 34 IFXJS_Runtime*                                  CJS_RuntimeFactory::NewJSRuntime
     (CPDFDoc_Environment* pApp) | 34 IFXJS_Runtime*                                  CJS_RuntimeFactory::NewJSRuntime
     (CPDFDoc_Environment* pApp) | 
| 35 { | 35 { | 
| 36         if (!m_bInit) | 36         if (!m_bInit) | 
| 37         { | 37         { | 
| 38 »       »       JS_Initial(); | 38 »       »       unsigned int embedderDataSlot = 0; | 
|  | 39 »       »       if (pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) { | 
|  | 40 »       »       »       embedderDataSlot = pApp->GetFormFillInfo()->m_pJsPlatfor
     m->m_v8EmbedderSlot; | 
|  | 41                 } | 
|  | 42 »       »       JS_Initial(embedderDataSlot); | 
| 39                 m_bInit = TRUE; | 43                 m_bInit = TRUE; | 
| 40         } | 44         } | 
| 41         return new CJS_Runtime(pApp); | 45         return new CJS_Runtime(pApp); | 
| 42 } | 46 } | 
| 43 void                                                    CJS_RuntimeFactory::AddR
     ef() | 47 void                                                    CJS_RuntimeFactory::AddR
     ef() | 
| 44 { | 48 { | 
| 45         //to do.Should be implemented as atom manipulation. | 49         //to do.Should be implemented as atom manipulation. | 
| 46         m_nRef++; | 50         m_nRef++; | 
| 47 } | 51 } | 
| 48 void                                                    CJS_RuntimeFactory::Rele
     ase() | 52 void                                                    CJS_RuntimeFactory::Rele
     ase() | 
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 338 { | 342 { | 
| 339         return v8::Local<v8::Context>::New(m_isolate, m_context); | 343         return v8::Local<v8::Context>::New(m_isolate, m_context); | 
| 340 } | 344 } | 
| 341 | 345 | 
| 342 CFX_WideString ChangeObjName(const CFX_WideString& str) | 346 CFX_WideString ChangeObjName(const CFX_WideString& str) | 
| 343 { | 347 { | 
| 344         CFX_WideString sRet = str; | 348         CFX_WideString sRet = str; | 
| 345         sRet.Replace(L"_", L"."); | 349         sRet.Replace(L"_", L"."); | 
| 346         return sRet; | 350         return sRet; | 
| 347 } | 351 } | 
| OLD | NEW | 
|---|