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

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

Issue 1244503002: Merge to XFA: Tidy up CPDFDOC_Environment. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address comments, also remove two noisy unused var. Created 5 years, 5 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/app.cpp ('k') | no next file » | 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/app.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698