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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 return TRUE; | 103 return TRUE; |
104 }; | 104 }; |
105 | 105 |
106 JSGlobalAlternate::JSGlobalAlternate(CJS_Object* pJSObject) | 106 JSGlobalAlternate::JSGlobalAlternate(CJS_Object* pJSObject) |
107 : CJS_EmbedObj(pJSObject), m_pApp(NULL) { | 107 : CJS_EmbedObj(pJSObject), m_pApp(NULL) { |
108 } | 108 } |
109 | 109 |
110 JSGlobalAlternate::~JSGlobalAlternate() { | 110 JSGlobalAlternate::~JSGlobalAlternate() { |
111 DestroyGlobalPersisitentVariables(); | 111 DestroyGlobalPersisitentVariables(); |
112 CPDFXFA_App::GetInstance()->GetRuntimeFactory()->ReleaseGlobalData(); | 112 m_pGlobalData->Release(); |
113 } | 113 } |
114 | 114 |
115 void JSGlobalAlternate::Initial(CPDFDoc_Environment* pApp) { | 115 void JSGlobalAlternate::Initial(CPDFDoc_Environment* pApp) { |
116 m_pApp = pApp; | 116 m_pApp = pApp; |
117 m_pGlobalData = | 117 m_pGlobalData = CJS_GlobalData::GetRetainedInstance(pApp); |
118 CPDFXFA_App::GetInstance()->GetRuntimeFactory()->NewGlobalData(pApp); | |
119 UpdateGlobalPersistentVariables(); | 118 UpdateGlobalPersistentVariables(); |
120 } | 119 } |
121 | 120 |
122 FX_BOOL JSGlobalAlternate::QueryProperty(const FX_WCHAR* propname) { | 121 FX_BOOL JSGlobalAlternate::QueryProperty(const FX_WCHAR* propname) { |
123 return CFX_WideString(propname) != L"setPersistent"; | 122 return CFX_WideString(propname) != L"setPersistent"; |
124 } | 123 } |
125 | 124 |
126 FX_BOOL JSGlobalAlternate::DelProperty(IFXJS_Context* cc, | 125 FX_BOOL JSGlobalAlternate::DelProperty(IFXJS_Context* cc, |
127 const FX_WCHAR* propname, | 126 const FX_WCHAR* propname, |
128 CFX_WideString& sError) { | 127 CFX_WideString& sError) { |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 return VT_boolean; | 536 return VT_boolean; |
538 if (nHash == JSCONST_nDateHash) | 537 if (nHash == JSCONST_nDateHash) |
539 return VT_date; | 538 return VT_date; |
540 if (nHash == JSCONST_nObjectHash) | 539 if (nHash == JSCONST_nObjectHash) |
541 return VT_object; | 540 return VT_object; |
542 if (nHash == JSCONST_nFXobjHash) | 541 if (nHash == JSCONST_nFXobjHash) |
543 return VT_fxobject; | 542 return VT_fxobject; |
544 | 543 |
545 return VT_unknown; | 544 return VT_unknown; |
546 } | 545 } |
OLD | NEW |