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

Side by Side Diff: fpdfsdk/src/javascript/JS_Define.h

Issue 1394023002: Merge to XFA: Remove unused global argument from FXJS_CONSTRUCTOR. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 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/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/jsapi/fxjs_v8.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 FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_ 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_
8 #define FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_ 8 #define FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_
9 9
10 #include "../../include/jsapi/fxjs_v8.h" 10 #include "../../include/jsapi/fxjs_v8.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 IMPLEMENT_JS_CLASS_RICH_PART(js_class_name, class_alternate, class_name) \ 235 IMPLEMENT_JS_CLASS_RICH_PART(js_class_name, class_alternate, class_name) \
236 void js_class_name::DefineJSObjects(v8::Isolate* pIsolate, \ 236 void js_class_name::DefineJSObjects(v8::Isolate* pIsolate, \
237 FXJSOBJTYPE eObjType) { \ 237 FXJSOBJTYPE eObjType) { \
238 g_nObjDefnID = FXJS_DefineObj(pIsolate, js_class_name::g_pClassName, \ 238 g_nObjDefnID = FXJS_DefineObj(pIsolate, js_class_name::g_pClassName, \
239 eObjType, JSConstructor, JSDestructor); \ 239 eObjType, JSConstructor, JSDestructor); \
240 DefineConsts(pIsolate); \ 240 DefineConsts(pIsolate); \
241 DefineProps(pIsolate); \ 241 DefineProps(pIsolate); \
242 DefineMethods(pIsolate); \ 242 DefineMethods(pIsolate); \
243 } 243 }
244 244
245 #define DECLARE_JS_CLASS_RICH_PART() \ 245 #define DECLARE_JS_CLASS_RICH_PART() \
246 static void JSConstructor(IFXJS_Context* cc, v8::Local<v8::Object> obj, \ 246 static void JSConstructor(IFXJS_Context* cc, v8::Local<v8::Object> obj); \
247 v8::Local<v8::Object> global); \ 247 static void JSDestructor(v8::Local<v8::Object> obj); \
248 static void JSDestructor(v8::Local<v8::Object> obj); \ 248 static void DefineProps(v8::Isolate* pIsoalte); \
249 static void DefineProps(v8::Isolate* pIsoalte); \ 249 static void DefineMethods(v8::Isolate* pIsoalte); \
250 static void DefineMethods(v8::Isolate* pIsoalte); \ 250 static JSPropertySpec JS_Class_Properties[]; \
251 static JSPropertySpec JS_Class_Properties[]; \
252 static JSMethodSpec JS_Class_Methods[]; 251 static JSMethodSpec JS_Class_Methods[];
253 252
254 #define IMPLEMENT_JS_CLASS_RICH_PART(js_class_name, class_alternate, \ 253 #define IMPLEMENT_JS_CLASS_RICH_PART(js_class_name, class_alternate, \
255 class_name) \ 254 class_name) \
256 void js_class_name::JSConstructor(IFXJS_Context* cc, \ 255 void js_class_name::JSConstructor(IFXJS_Context* cc, \
257 v8::Local<v8::Object> obj, \ 256 v8::Local<v8::Object> obj) { \
258 v8::Local<v8::Object> global) { \
259 CJS_Object* pObj = new js_class_name(obj); \ 257 CJS_Object* pObj = new js_class_name(obj); \
260 pObj->SetEmbedObject(new class_alternate(pObj)); \ 258 pObj->SetEmbedObject(new class_alternate(pObj)); \
261 FXJS_SetPrivate(nullptr, obj, (void*)pObj); \ 259 FXJS_SetPrivate(nullptr, obj, (void*)pObj); \
262 pObj->InitInstance(cc); \ 260 pObj->InitInstance(cc); \
263 } \ 261 } \
264 void js_class_name::JSDestructor(v8::Local<v8::Object> obj) { \ 262 void js_class_name::JSDestructor(v8::Local<v8::Object> obj) { \
265 js_class_name* pObj = (js_class_name*)FXJS_GetPrivate(nullptr, obj); \ 263 js_class_name* pObj = (js_class_name*)FXJS_GetPrivate(nullptr, obj); \
266 pObj->ExitInstance(); \ 264 pObj->ExitInstance(); \
267 delete pObj; \ 265 delete pObj; \
268 } \ 266 } \
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 for (size_t i = 0; i < FX_ArraySize(global_methods) - 1; ++i) { \ 476 for (size_t i = 0; i < FX_ArraySize(global_methods) - 1; ++i) { \
479 FXJS_DefineGlobalMethod(pIsolate, \ 477 FXJS_DefineGlobalMethod(pIsolate, \
480 js_class_name::global_methods[i].pName, \ 478 js_class_name::global_methods[i].pName, \
481 js_class_name::global_methods[i].pMethodCall); \ 479 js_class_name::global_methods[i].pMethodCall); \
482 } \ 480 } \
483 } 481 }
484 482
485 CJS_Value::Type GET_VALUE_TYPE(v8::Local<v8::Value> p); 483 CJS_Value::Type GET_VALUE_TYPE(v8::Local<v8::Value> p);
486 484
487 #endif // FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_ 485 #endif // FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_
OLDNEW
« no previous file with comments | « fpdfsdk/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698