summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-02-21 13:57:13 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-02-21 22:43:48 +0000
commit892d7510db7015b1835d8e057a716518881f126d (patch)
treef57ce39c39e1fd4b20312819c6a9cd795c7e96df /fpdfsdk
parentd476adcab3b1b79b921c0003f8d8caad1bb1d00b (diff)
downloadpdfium-892d7510db7015b1835d8e057a716518881f126d.tar.xz
Avoid some widestring to bytestring conversions in fxjs.
None of the names have non-ascii characters. Change-Id: I83a52d6276edf2f442fca33221f38f6a53c3ffe3 Reviewed-on: https://pdfium-review.googlesource.com/2816 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/javascript/JS_Define.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/fpdfsdk/javascript/JS_Define.h b/fpdfsdk/javascript/JS_Define.h
index 6ad00632d3..4f5cc5d66e 100644
--- a/fpdfsdk/javascript/JS_Define.h
+++ b/fpdfsdk/javascript/JS_Define.h
@@ -34,8 +34,6 @@ struct JSMethodSpec {
v8::FunctionCallback pMethodCall;
};
-#define JS_WIDESTRING(widestring) L## #widestring
-
template <class C, bool (C::*M)(CJS_Runtime*, CJS_PropValue&, CFX_WideString&)>
void JSPropGetter(const char* prop_name_string,
const char* class_name_string,
@@ -141,13 +139,13 @@ void JSMethod(const char* method_name_string,
// All JS classes have a name, an object defintion ID, and the ability to
// register themselves with FXJS_V8. We never make a BASE class on its own
// because it can't really do anything.
-#define DECLARE_JS_CLASS_BASE_PART() \
- static const wchar_t* g_pClassName; \
- static int g_nObjDefnID; \
+#define DECLARE_JS_CLASS_BASE_PART() \
+ static const char* g_pClassName; \
+ static int g_nObjDefnID; \
static void DefineJSObjects(CFXJS_Engine* pEngine, FXJSOBJTYPE eObjType);
-#define IMPLEMENT_JS_CLASS_BASE_PART(js_class_name, class_name) \
- const wchar_t* js_class_name::g_pClassName = JS_WIDESTRING(class_name); \
+#define IMPLEMENT_JS_CLASS_BASE_PART(js_class_name, class_name) \
+ const char* js_class_name::g_pClassName = #class_name; \
int js_class_name::g_nObjDefnID = -1;
// CONST classes provide constants, but not constructors, methods, or props.