summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/jsapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-09-11 13:04:48 -0700
committerTom Sepez <tsepez@chromium.org>2015-09-11 13:04:48 -0700
commitf9e40aec10263f9445d69598657f42550294d653 (patch)
treeeb20eaef0841334b14266b4a83efe34ade7b1b0e /fpdfsdk/include/jsapi
parentdf4de98c06075b0e491ac645f2d118a6813cedc9 (diff)
downloadpdfium-f9e40aec10263f9445d69598657f42550294d653.tar.xz
Fix strings, remove stringify macros, void return types for Consts.h.
Replace multiple #defines of the same strings with externs. Fix strings mangled by interaction of # and clang-format. Remove macros as possible. Make more JS_ functions void and simplify. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1342433002 .
Diffstat (limited to 'fpdfsdk/include/jsapi')
-rw-r--r--fpdfsdk/include/jsapi/fxjs_v8.h60
1 files changed, 34 insertions, 26 deletions
diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h
index 8e52c68845..4195686731 100644
--- a/fpdfsdk/include/jsapi/fxjs_v8.h
+++ b/fpdfsdk/include/jsapi/fxjs_v8.h
@@ -36,8 +36,14 @@ struct FXJSErr {
unsigned linnum;
};
-/* --------------------------------------------- API
- * --------------------------------------------- */
+extern const wchar_t kFXJSValueNameString[];
+extern const wchar_t kFXJSValueNameNumber[];
+extern const wchar_t kFXJSValueNameBoolean[];
+extern const wchar_t kFXJSValueNameDate[];
+extern const wchar_t kFXJSValueNameObject[];
+extern const wchar_t kFXJSValueNameFxobj[];
+extern const wchar_t kFXJSValueNameNull[];
+extern const wchar_t kFXJSValueNameUndefined[];
class IFXJS_Context;
class IFXJS_Runtime;
@@ -47,36 +53,38 @@ typedef void (*LP_CONSTRUCTOR)(IFXJS_Context* cc,
v8::Local<v8::Object> global);
typedef void (*LP_DESTRUCTOR)(v8::Local<v8::Object> obj);
+// Always returns a valid, newly-created objDefnID.
int JS_DefineObj(v8::Isolate* pIsolate,
const wchar_t* sObjName,
FXJSOBJTYPE eObjType,
LP_CONSTRUCTOR pConstructor,
LP_DESTRUCTOR pDestructor);
-int JS_DefineObjMethod(v8::Isolate* pIsolate,
+
+void JS_DefineObjMethod(v8::Isolate* pIsolate,
+ int nObjDefnID,
+ const wchar_t* sMethodName,
+ v8::FunctionCallback pMethodCall);
+void JS_DefineObjProperty(v8::Isolate* pIsolate,
+ int nObjDefnID,
+ const wchar_t* sPropName,
+ v8::AccessorGetterCallback pPropGet,
+ v8::AccessorSetterCallback pPropPut);
+void JS_DefineObjAllProperties(v8::Isolate* pIsolate,
+ int nObjDefnID,
+ v8::NamedPropertyQueryCallback pPropQurey,
+ v8::NamedPropertyGetterCallback pPropGet,
+ v8::NamedPropertySetterCallback pPropPut,
+ v8::NamedPropertyDeleterCallback pPropDel);
+void JS_DefineObjConst(v8::Isolate* pIsolate,
int nObjDefnID,
- const wchar_t* sMethodName,
- v8::FunctionCallback pMethodCall);
-int JS_DefineObjProperty(v8::Isolate* pIsolate,
- int nObjDefnID,
- const wchar_t* sPropName,
- v8::AccessorGetterCallback pPropGet,
- v8::AccessorSetterCallback pPropPut);
-int JS_DefineObjAllProperties(v8::Isolate* pIsolate,
- int nObjDefnID,
- v8::NamedPropertyQueryCallback pPropQurey,
- v8::NamedPropertyGetterCallback pPropGet,
- v8::NamedPropertySetterCallback pPropPut,
- v8::NamedPropertyDeleterCallback pPropDel);
-int JS_DefineObjConst(v8::Isolate* pIsolate,
- int nObjDefnID,
- const wchar_t* sConstName,
- v8::Local<v8::Value> pDefault);
-int JS_DefineGlobalMethod(v8::Isolate* pIsolate,
- const wchar_t* sMethodName,
- v8::FunctionCallback pMethodCall);
-int JS_DefineGlobalConst(v8::Isolate* pIsolate,
- const wchar_t* sConstName,
- v8::Local<v8::Value> pDefault);
+ const wchar_t* sConstName,
+ v8::Local<v8::Value> pDefault);
+void JS_DefineGlobalMethod(v8::Isolate* pIsolate,
+ const wchar_t* sMethodName,
+ v8::FunctionCallback pMethodCall);
+void JS_DefineGlobalConst(v8::Isolate* pIsolate,
+ const wchar_t* sConstName,
+ v8::Local<v8::Value> pDefault);
void JS_InitialRuntime(v8::Isolate* pIsolate,
IFXJS_Runtime* pFXRuntime,