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