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

Unified Diff: fpdfsdk/include/javascript/JS_Define.h

Issue 969203002: Merge to XFA: Kill off JS_ErrorString type. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/javascript/Icon.h ('k') | fpdfsdk/include/javascript/JS_Value.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/include/javascript/JS_Define.h
diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h
index 7b98ee6dd256a2085523323008dfb06f9b0ce5f8..2213ff9e392bb199607d2d573b7168d2895f5217 100644
--- a/fpdfsdk/include/javascript/JS_Define.h
+++ b/fpdfsdk/include/javascript/JS_Define.h
@@ -13,7 +13,6 @@
typedef v8::Value JSValue;
typedef v8::Handle<v8::Object> JSObject;
typedef v8::Handle<v8::Object> JSFXObject;
-typedef unsigned JSBool;
#include "JS_Object.h"
#include "JS_Value.h"
@@ -40,13 +39,6 @@ struct JSMethodSpec
unsigned nParamNum;
};
-#define JS_TRUE (unsigned)1
-#define JS_FALSE (unsigned)0
-
-typedef CFX_WideString JS_ErrorString;
-typedef CFX_ArrayTemplate<float> CJS_PointsArray;
-typedef CFX_ArrayTemplate<int> CJS_IntArray;
-
/* ====================================== PUBLIC DEFINE SPEC ============================================== */
#define JS_WIDESTRING(widestring) L###widestring
@@ -160,8 +152,8 @@ void JSMethod(const char* method_name_string,
/* ===================================== JS CLASS =============================================== */
#define DECLARE_JS_CLASS(js_class_name) \
- static JSBool JSConstructor(IFXJS_Context* cc, JSFXObject obj,JSFXObject global);\
- static JSBool JSDestructor(JSFXObject obj);\
+ static void JSConstructor(IFXJS_Context* cc, JSFXObject obj,JSFXObject global);\
+ static void JSDestructor(JSFXObject obj);\
static int Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType);\
static JSConstSpec JS_Class_Consts[];\
static JSPropertySpec JS_Class_Properties[];\
@@ -170,22 +162,20 @@ void JSMethod(const char* method_name_string,
#define IMPLEMENT_JS_CLASS_RICH(js_class_name, class_alternate, class_name) \
const wchar_t* js_class_name::m_pClassName = JS_WIDESTRING(class_name);\
-JSBool js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj, JSFXObject global)\
+void js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj, JSFXObject global)\
{\
CJS_Object* pObj = FX_NEW js_class_name(obj);\
pObj->SetEmbedObject(FX_NEW class_alternate(pObj));\
JS_SetPrivate(NULL,obj,(void*)pObj); \
pObj->InitInstance(cc);\
- return JS_TRUE;\
}\
\
-JSBool js_class_name::JSDestructor(JSFXObject obj) \
+void js_class_name::JSDestructor(JSFXObject obj) \
{\
js_class_name* pObj = (js_class_name*)JS_GetPrivate(NULL,obj);\
ASSERT(pObj != NULL);\
pObj->ExitInstance();\
delete pObj;\
- return JS_TRUE;\
}\
\
int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\
@@ -315,8 +305,8 @@ void JSSpecialPropDel(const char* class_name,
}
#define DECLARE_SPECIAL_JS_CLASS(js_class_name) \
- static JSBool JSConstructor(IFXJS_Context* cc, JSFXObject obj, JSFXObject global);\
- static JSBool JSDestructor(JSFXObject obj);\
+ static void JSConstructor(IFXJS_Context* cc, JSFXObject obj, JSFXObject global);\
+ static void JSDestructor(JSFXObject obj);\
static JSConstSpec JS_Class_Consts[];\
static JSPropertySpec JS_Class_Properties[];\
static JSMethodSpec JS_Class_Methods[];\
@@ -341,22 +331,20 @@ void js_class_name::putprop_##js_class_name##_static(v8::Local<v8::String> prope
void js_class_name::delprop_##js_class_name##_static(v8::Local<v8::String> property,const v8::PropertyCallbackInfo<v8::Boolean>& info) { \
JSSpecialPropDel<class_alternate>(#class_name, property, info); \
} \
-JSBool js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj,JSFXObject global)\
+void js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj,JSFXObject global)\
{\
CJS_Object* pObj = FX_NEW js_class_name(obj);\
pObj->SetEmbedObject(FX_NEW class_alternate(pObj));\
JS_SetPrivate(NULL,obj, (void*)pObj); \
pObj->InitInstance(cc);\
- return JS_TRUE;\
}\
\
-JSBool js_class_name::JSDestructor(JSFXObject obj) \
+void js_class_name::JSDestructor(JSFXObject obj) \
{\
js_class_name* pObj = (js_class_name*)JS_GetPrivate(NULL,obj);\
ASSERT(pObj != NULL);\
pObj->ExitInstance();\
delete pObj;\
- return JS_TRUE;\
}\
\
int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\
« no previous file with comments | « fpdfsdk/include/javascript/Icon.h ('k') | fpdfsdk/include/javascript/JS_Value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698