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

Side by Side Diff: fpdfsdk/src/jsapi/fxjs_v8.cpp

Issue 1105813002: Merge to XFA: Remove unused nParamNum values from JS method tables. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 8 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/util.cpp ('k') | testing/resources/javascript/document_methods.in » ('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 "../../../core/include/fxcrt/fx_basic.h" 7 #include "../../../core/include/fxcrt/fx_basic.h"
8 #include "../../../core/include/fxcrt/fx_ext.h" 8 #include "../../../core/include/fxcrt/fx_ext.h"
9 #include "../../include/jsapi/fxjs_v8.h" 9 #include "../../include/jsapi/fxjs_v8.h"
10 #include "../../include/fsdk_define.h" 10 #include "../../include/fsdk_define.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if(!pArray) 83 if(!pArray)
84 { 84 {
85 pArray = FX_NEW CFX_PtrArray(); 85 pArray = FX_NEW CFX_PtrArray();
86 isolate->SetData(1, pArray); 86 isolate->SetData(1, pArray);
87 } 87 }
88 CJS_ObjDefintion* pObjDef = FX_NEW CJS_ObjDefintion(isolate, sObjName, e ObjType, pConstructor, pDestructor, bApplyNew); 88 CJS_ObjDefintion* pObjDef = FX_NEW CJS_ObjDefintion(isolate, sObjName, e ObjType, pConstructor, pDestructor, bApplyNew);
89 pArray->Add(pObjDef); 89 pArray->Add(pObjDef);
90 return pArray->GetSize()-1; 90 return pArray->GetSize()-1;
91 } 91 }
92 92
93 int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* s MethodName, v8::FunctionCallback pMethodCall, unsigned nParamNum) 93 int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* s MethodName, v8::FunctionCallback pMethodCall)
94 { 94 {
95 v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; 95 v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
96 v8::Isolate::Scope isolate_scope(isolate); 96 v8::Isolate::Scope isolate_scope(isolate);
97 v8::HandleScope handle_scope(isolate); 97 v8::HandleScope handle_scope(isolate);
98 98
99 CFX_WideString ws = CFX_WideString(sMethodName); 99 CFX_WideString ws = CFX_WideString(sMethodName);
100 CFX_ByteString bsMethodName = ws.UTF8Encode(); 100 CFX_ByteString bsMethodName = ws.UTF8Encode();
101 101
102 CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(1); 102 CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(1);
103 if(!pArray) return 0; 103 if(!pArray) return 0;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 for(int i=0; i<pArray->GetSize(); i++) 178 for(int i=0; i<pArray->GetSize(); i++)
179 { 179 {
180 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(i); 180 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(i);
181 if(pObjDef->m_bSetAsGlobalObject) 181 if(pObjDef->m_bSetAsGlobalObject)
182 return pObjDef->m_objTemplate; 182 return pObjDef->m_objTemplate;
183 } 183 }
184 static v8::Persistent<v8::ObjectTemplate> gloabalObjectTemplate; 184 static v8::Persistent<v8::ObjectTemplate> gloabalObjectTemplate;
185 return gloabalObjectTemplate; 185 return gloabalObjectTemplate;
186 } 186 }
187 187
188 int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v 8::FunctionCallback pMethodCall, unsigned nParamNum) 188 int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v 8::FunctionCallback pMethodCall)
189 { 189 {
190 v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; 190 v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
191 v8::Isolate::Scope isolate_scope(isolate); 191 v8::Isolate::Scope isolate_scope(isolate);
192 v8::HandleScope handle_scope(isolate); 192 v8::HandleScope handle_scope(isolate);
193 193
194 CFX_WideString ws = CFX_WideString(sMethodName); 194 CFX_WideString ws = CFX_WideString(sMethodName);
195 CFX_ByteString bsMethodName = ws.UTF8Encode(); 195 CFX_ByteString bsMethodName = ws.UTF8Encode();
196 196
197 v8::Local<v8::FunctionTemplate> funTempl = v8::FunctionTemplate::New(iso late, pMethodCall); 197 v8::Local<v8::FunctionTemplate> funTempl = v8::FunctionTemplate::New(iso late, pMethodCall);
198 v8::Local<v8::ObjectTemplate> objTemp; 198 v8::Local<v8::ObjectTemplate> objTemp;
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 { 1044 {
1045 return d != d; 1045 return d != d;
1046 } 1046 }
1047 1047
1048 double JS_LocalTime(double d) 1048 double JS_LocalTime(double d)
1049 { 1049 {
1050 return JS_GetDateTime() + _getDaylightSavingTA(d); 1050 return JS_GetDateTime() + _getDaylightSavingTA(d);
1051 } 1051 }
1052 1052
1053 //JavaScript time implement End. 1053 //JavaScript time implement End.
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/util.cpp ('k') | testing/resources/javascript/document_methods.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698