| 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/IJavaScript.h" | 7 #include "../../include/javascript/IJavaScript.h" |
| 8 #include "../../include/javascript/JS_Context.h" | 8 #include "../../include/javascript/JS_Context.h" |
| 9 #include "../../include/javascript/JS_Define.h" | 9 #include "../../include/javascript/JS_Define.h" |
| 10 #include "../../include/javascript/JS_EventHandler.h" | 10 #include "../../include/javascript/JS_EventHandler.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 global_alternate::global_alternate(CJS_Object* pJSObject) | 113 global_alternate::global_alternate(CJS_Object* pJSObject) |
| 114 : CJS_EmbedObj(pJSObject), | 114 : CJS_EmbedObj(pJSObject), |
| 115 m_pApp(NULL) | 115 m_pApp(NULL) |
| 116 { | 116 { |
| 117 } | 117 } |
| 118 | 118 |
| 119 global_alternate::~global_alternate(void) | 119 global_alternate::~global_alternate(void) |
| 120 { | 120 { |
| 121 ASSERT(m_pApp != NULL); | |
| 122 DestroyGlobalPersisitentVariables(); | 121 DestroyGlobalPersisitentVariables(); |
| 123 | 122 » CPDFXFA_App::GetInstance()->GetRuntimeFactory()->ReleaseGlobalData(); |
| 124 » CJS_RuntimeFactory* pFactory = CPDFXFA_App::GetInstance()->GetRuntimeFac
tory(); | |
| 125 » pFactory->ReleaseGlobalData(); | |
| 126 } | 123 } |
| 127 | 124 |
| 128 void global_alternate::Initial(CPDFDoc_Environment* pApp) | 125 void global_alternate::Initial(CPDFDoc_Environment* pApp) |
| 129 { | 126 { |
| 130 m_pApp = pApp; | 127 m_pApp = pApp; |
| 131 | 128 » m_pGlobalData = CPDFXFA_App::GetInstance()->GetRuntimeFactory()->NewGlob
alData(pApp); |
| 132 » CJS_RuntimeFactory* pFactory = CPDFXFA_App::GetInstance()->GetRuntimeFac
tory(); | |
| 133 » m_pGlobalData = pFactory->NewGlobalData(pApp); | |
| 134 UpdateGlobalPersistentVariables(); | 129 UpdateGlobalPersistentVariables(); |
| 135 } | 130 } |
| 136 | 131 |
| 137 FX_BOOL global_alternate::QueryProperty(const FX_WCHAR* propname) | 132 FX_BOOL global_alternate::QueryProperty(const FX_WCHAR* propname) |
| 138 { | 133 { |
| 139 return CFX_WideString(propname) != L"setPersistent"; | 134 return CFX_WideString(propname) != L"setPersistent"; |
| 140 } | 135 } |
| 141 | 136 |
| 142 FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propnam
e, CFX_WideString& sError) | 137 FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propnam
e, CFX_WideString& sError) |
| 143 { | 138 { |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 if (nHash == JSCONST_nDateHash) | 614 if (nHash == JSCONST_nDateHash) |
| 620 return VT_date; | 615 return VT_date; |
| 621 if (nHash == JSCONST_nObjectHash) | 616 if (nHash == JSCONST_nObjectHash) |
| 622 return VT_object; | 617 return VT_object; |
| 623 if (nHash == JSCONST_nFXobjHash) | 618 if (nHash == JSCONST_nFXobjHash) |
| 624 return VT_fxobject; | 619 return VT_fxobject; |
| 625 | 620 |
| 626 return VT_unknown; | 621 return VT_unknown; |
| 627 } | 622 } |
| 628 | 623 |
| OLD | NEW |