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

Side by Side Diff: xfa/fxfa/parser/xfa_script.h

Issue 2014863002: Revert of Remove parameters which are always null (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 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 | « xfa/fxfa/fm2js/xfa_fm2jscontext.cpp ('k') | xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp » ('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 #ifndef XFA_FXFA_PARSER_XFA_SCRIPT_H_ 7 #ifndef XFA_FXFA_PARSER_XFA_SCRIPT_H_
8 #define XFA_FXFA_PARSER_XFA_SCRIPT_H_ 8 #define XFA_FXFA_PARSER_XFA_SCRIPT_H_
9 9
10 #include "xfa/fxfa/include/fxfa.h" 10 #include "xfa/fxfa/include/fxfa.h"
(...skipping 27 matching lines...) Expand all
38 class CXFA_HVALUEArray : public CFX_ArrayTemplate<FXJSE_HVALUE> { 38 class CXFA_HVALUEArray : public CFX_ArrayTemplate<FXJSE_HVALUE> {
39 public: 39 public:
40 CXFA_HVALUEArray(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {} 40 CXFA_HVALUEArray(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {}
41 ~CXFA_HVALUEArray() { 41 ~CXFA_HVALUEArray() {
42 for (int32_t i = 0; i < GetSize(); i++) { 42 for (int32_t i = 0; i < GetSize(); i++) {
43 FXJSE_Value_Release(GetAt(i)); 43 FXJSE_Value_Release(GetAt(i));
44 } 44 }
45 } 45 }
46 void GetAttributeObject(CXFA_ObjArray& objArray) { 46 void GetAttributeObject(CXFA_ObjArray& objArray) {
47 for (int32_t i = 0; i < GetSize(); i++) { 47 for (int32_t i = 0; i < GetSize(); i++) {
48 CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(GetAt(i)); 48 CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(GetAt(i), NULL);
49 objArray.Add(pObject); 49 objArray.Add(pObject);
50 } 50 }
51 } 51 }
52 v8::Isolate* m_pIsolate; 52 v8::Isolate* m_pIsolate;
53 }; 53 };
54 54
55 struct XFA_RESOLVENODE_RS { 55 struct XFA_RESOLVENODE_RS {
56 XFA_RESOLVENODE_RS() 56 XFA_RESOLVENODE_RS()
57 : dwFlags(XFA_RESOVENODE_RSTYPE_Nodes), pScriptAttribute(NULL) {} 57 : dwFlags(XFA_RESOVENODE_RSTYPE_Nodes), pScriptAttribute(NULL) {}
58 ~XFA_RESOLVENODE_RS() { nodes.RemoveAll(); } 58 ~XFA_RESOLVENODE_RS() { nodes.RemoveAll(); }
59 int32_t GetAttributeResult(CXFA_HVALUEArray& hValueArray) const { 59 int32_t GetAttributeResult(CXFA_HVALUEArray& hValueArray) const {
60 if (pScriptAttribute && pScriptAttribute->eValueType == XFA_SCRIPT_Object) { 60 if (pScriptAttribute && pScriptAttribute->eValueType == XFA_SCRIPT_Object) {
61 v8::Isolate* pIsolate = hValueArray.m_pIsolate; 61 v8::Isolate* pIsolate = hValueArray.m_pIsolate;
62 for (int32_t i = 0; i < nodes.GetSize(); i++) { 62 for (int32_t i = 0; i < nodes.GetSize(); i++) {
63 FXJSE_HVALUE hValue = FXJSE_Value_Create(pIsolate); 63 FXJSE_HVALUE hValue = FXJSE_Value_Create(pIsolate);
64 (nodes[i]->*(pScriptAttribute->lpfnCallback))( 64 (nodes[i]->*(pScriptAttribute->lpfnCallback))(
65 hValue, FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute); 65 hValue, FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute);
66 hValueArray.Add(hValue); 66 hValueArray.Add(hValue);
67 } 67 }
68 } 68 }
69 return hValueArray.GetSize(); 69 return hValueArray.GetSize();
70 } 70 }
71 71
72 CXFA_ObjArray nodes; 72 CXFA_ObjArray nodes;
73 XFA_RESOVENODE_RSTYPE dwFlags; 73 XFA_RESOVENODE_RSTYPE dwFlags;
74 const XFA_SCRIPTATTRIBUTEINFO* pScriptAttribute; 74 const XFA_SCRIPTATTRIBUTEINFO* pScriptAttribute;
75 }; 75 };
76 76
77 #endif // XFA_FXFA_PARSER_XFA_SCRIPT_H_ 77 #endif // XFA_FXFA_PARSER_XFA_SCRIPT_H_
OLDNEW
« no previous file with comments | « xfa/fxfa/fm2js/xfa_fm2jscontext.cpp ('k') | xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698