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

Side by Side Diff: xfa/fxfa/parser/cxfa_scriptcontext.cpp

Issue 2421603002: Reland: Make the CPDFXFA_App non-global (Closed)
Patch Set: Review feedback Created 4 years, 1 month 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 | « fxjs/fxjs_v8.cpp ('k') | xfa/fxfa/xfa_ffdoc.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 "xfa/fxfa/parser/cxfa_scriptcontext.h" 7 #include "xfa/fxfa/parser/cxfa_scriptcontext.h"
8 8
9 #include "core/fxcrt/fx_ext.h" 9 #include "core/fxcrt/fx_ext.h"
10 #include "fxjs/cfxjse_arguments.h" 10 #include "fxjs/cfxjse_arguments.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 CFXJSE_Context* pVariableContext = nullptr; 128 CFXJSE_Context* pVariableContext = nullptr;
129 m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext); 129 m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext);
130 130
131 delete ToThisProxy(pVariableContext->GetGlobalObject().get(), nullptr); 131 delete ToThisProxy(pVariableContext->GetGlobalObject().get(), nullptr);
132 delete pVariableContext; 132 delete pVariableContext;
133 } 133 }
134 m_mapVariableToContext.RemoveAll(); 134 m_mapVariableToContext.RemoveAll();
135 135
136 m_upObjectArray.RemoveAll(); 136 m_upObjectArray.RemoveAll();
137 } 137 }
138
138 void CXFA_ScriptContext::Initialize(v8::Isolate* pIsolate) { 139 void CXFA_ScriptContext::Initialize(v8::Isolate* pIsolate) {
139 m_pIsolate = pIsolate; 140 m_pIsolate = pIsolate;
140 DefineJsContext(); 141 DefineJsContext();
141 DefineJsClass(); 142 DefineJsClass();
142 m_ResolveProcessor.reset(new CXFA_ResolveProcessor); 143 m_ResolveProcessor.reset(new CXFA_ResolveProcessor);
143 } 144 }
144 FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, 145 FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType,
145 const CFX_WideStringC& wsScript, 146 const CFX_WideStringC& wsScript,
146 CFXJSE_Value* hRetValue, 147 CFXJSE_Value* hRetValue,
147 CXFA_Object* pThisObject) { 148 CXFA_Object* pThisObject) {
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 return; 763 return;
763 if (nodes.GetSize() > 0) 764 if (nodes.GetSize() > 0)
764 m_pScriptNodeArray->Copy(nodes); 765 m_pScriptNodeArray->Copy(nodes);
765 } 766 }
766 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { 767 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) {
767 if (!m_pScriptNodeArray) 768 if (!m_pScriptNodeArray)
768 return; 769 return;
769 if (m_pScriptNodeArray->Find(pNode) == -1) 770 if (m_pScriptNodeArray->Find(pNode) == -1)
770 m_pScriptNodeArray->Add(pNode); 771 m_pScriptNodeArray->Add(pNode);
771 } 772 }
OLDNEW
« no previous file with comments | « fxjs/fxjs_v8.cpp ('k') | xfa/fxfa/xfa_ffdoc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698