Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: fpdfsdk/src/javascript/global.cpp

Issue 1341913002: Merge to XFA: Get CJS_RuntimeFactory out of CJS_GlobalData management. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« fpdfsdk/src/javascript/JS_GlobalData.cpp ('K') | « fpdfsdk/src/javascript/JS_Runtime.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698