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

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

Issue 1153553003: Make CPDFXFA_App / IXFA_AppProvider saner (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address comments. Created 5 years, 7 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
« no previous file with comments | « fpdfsdk/src/javascript/JS_Runtime.cpp ('k') | xfa/include/fxfa/fxfa.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 121 ASSERT(m_pApp != NULL);
122
123 // CommitGlobalPersisitentVariables();
124 DestroyGlobalPersisitentVariables(); 122 DestroyGlobalPersisitentVariables();
125 123
126 » CJS_RuntimeFactory* pFactory = FPDFXFA_GetApp()->GetRuntimeFactory(); 124 » CJS_RuntimeFactory* pFactory = CPDFXFA_App::GetInstance()->GetRuntimeFac tory();
127 » ASSERT(pFactory);
128
129 pFactory->ReleaseGlobalData(); 125 pFactory->ReleaseGlobalData();
130 } 126 }
131 127
132 void global_alternate::Initial(CPDFDoc_Environment* pApp) 128 void global_alternate::Initial(CPDFDoc_Environment* pApp)
133 { 129 {
134 m_pApp = pApp; 130 m_pApp = pApp;
135 131
136 » CJS_RuntimeFactory* pFactory = FPDFXFA_GetApp()->GetRuntimeFactory(); 132 » CJS_RuntimeFactory* pFactory = CPDFXFA_App::GetInstance()->GetRuntimeFac tory();
137 » ASSERT(pFactory);
138 m_pGlobalData = pFactory->NewGlobalData(pApp); 133 m_pGlobalData = pFactory->NewGlobalData(pApp);
139 UpdateGlobalPersistentVariables(); 134 UpdateGlobalPersistentVariables();
140 } 135 }
141 136
142 FX_BOOL global_alternate::QueryProperty(FX_LPCWSTR propname) 137 FX_BOOL global_alternate::QueryProperty(FX_LPCWSTR propname)
143 { 138 {
144 return CFX_WideString(propname) != L"setPersistent"; 139 return CFX_WideString(propname) != L"setPersistent";
145 } 140 }
146 141
147 FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CF X_WideString& sError) 142 FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CF X_WideString& sError)
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 if (nHash == JSCONST_nDateHash) 619 if (nHash == JSCONST_nDateHash)
625 return VT_date; 620 return VT_date;
626 if (nHash == JSCONST_nObjectHash) 621 if (nHash == JSCONST_nObjectHash)
627 return VT_object; 622 return VT_object;
628 if (nHash == JSCONST_nFXobjHash) 623 if (nHash == JSCONST_nFXobjHash)
629 return VT_fxobject; 624 return VT_fxobject;
630 625
631 return VT_unknown; 626 return VT_unknown;
632 } 627 }
633 628
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/JS_Runtime.cpp ('k') | xfa/include/fxfa/fxfa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698