diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-10-24 21:40:24 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-25 18:14:09 +0000 |
commit | 80435cb746fa7bd22cf062ab39829ec86000fd21 (patch) | |
tree | 9085fa57d5f49eac4b56b065ca572f424c9f744b /fpdfsdk/javascript/JS_Define.h | |
parent | e85107bc8ab5bbd5b2d3f97fd6071d7ce4a78bcc (diff) | |
download | pdfium-80435cb746fa7bd22cf062ab39829ec86000fd21.tar.xz |
Convert JS input params to v8::Local<v8::Value>>s
This CL converts the JS set_* methods and the JSMethod methods to accept
v8::Local<v8::Value> objects instead of CJS_Value objects.
Change-Id: I6de41305deff458eba515bdc3462522b502f74ad
Reviewed-on: https://pdfium-review.googlesource.com/16670
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/JS_Define.h')
-rw-r--r-- | fpdfsdk/javascript/JS_Define.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fpdfsdk/javascript/JS_Define.h b/fpdfsdk/javascript/JS_Define.h index 46469d7dec..819cc9c25e 100644 --- a/fpdfsdk/javascript/JS_Define.h +++ b/fpdfsdk/javascript/JS_Define.h @@ -61,7 +61,8 @@ void JSPropGetter(const char* prop_name_string, info.GetReturnValue().Set(prop_value.ToV8Value()); } -template <class C, bool (C::*M)(CJS_Runtime*, const CJS_Value&, WideString*)> +template <class C, + bool (C::*M)(CJS_Runtime*, v8::Local<v8::Value>, WideString*)> void JSPropSetter(const char* prop_name_string, const char* class_name_string, v8::Local<v8::String> property, @@ -80,8 +81,7 @@ void JSPropSetter(const char* prop_name_string, C* pObj = reinterpret_cast<C*>(pJSObj->GetEmbedObject()); WideString sError; - CJS_Value prop_value(value); - if (!(pObj->*M)(pRuntime, prop_value, &sError)) { + if (!(pObj->*M)(pRuntime, value, &sError)) { pRuntime->Error( JSFormatErrorString(class_name_string, prop_name_string, sError)); } @@ -103,7 +103,7 @@ void JSPropSetter(const char* prop_name_string, template <class C, bool (C::*M)(CJS_Runtime*, - const std::vector<CJS_Value>&, + const std::vector<v8::Local<v8::Value>>&, CJS_Value&, WideString&)> void JSMethod(const char* method_name_string, @@ -114,9 +114,9 @@ void JSMethod(const char* method_name_string, if (!pRuntime) return; - std::vector<CJS_Value> parameters; + std::vector<v8::Local<v8::Value>> parameters; for (unsigned int i = 0; i < (unsigned int)info.Length(); i++) - parameters.push_back(CJS_Value(info[i])); + parameters.push_back(info[i]); CJS_Object* pJSObj = static_cast<CJS_Object*>(pRuntime->GetObjectPrivate(info.Holder())); |