summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/JS_Value.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-24 09:36:16 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-24 17:17:03 +0000
commite49749265c4e503c37a316e4ca6eeff430d13b87 (patch)
treed75c0b641618e66477b2e992ae146f30a3e2dd9f /fpdfsdk/javascript/JS_Value.h
parent826480cf599f61fe0366ab2bd5803dd53c9d0562 (diff)
downloadpdfium-e49749265c4e503c37a316e4ca6eeff430d13b87.tar.xz
Remove most CJS_Value Set methods
This CL removes all of the Set(*) methods from CJS_Value except for Set(v8::Local<v8::Value>). All uses of Set are changed to convert to a v8::Value before setting. Change-Id: I6e4d2cebec42fce5c039dc0a3abe46086cfdd34f Reviewed-on: https://pdfium-review.googlesource.com/16610 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/JS_Value.h')
-rw-r--r--fpdfsdk/javascript/JS_Value.h28
1 files changed, 8 insertions, 20 deletions
diff --git a/fpdfsdk/javascript/JS_Value.h b/fpdfsdk/javascript/JS_Value.h
index 49dd2492da..72d381e188 100644
--- a/fpdfsdk/javascript/JS_Value.h
+++ b/fpdfsdk/javascript/JS_Value.h
@@ -32,34 +32,22 @@ class CJS_Value {
static Type GetValueType(v8::Local<v8::Value> value);
- explicit CJS_Value(CJS_Runtime* pRuntime);
- CJS_Value(CJS_Runtime* pRuntime, v8::Local<v8::Value> pValue);
+ CJS_Value();
+ explicit CJS_Value(v8::Local<v8::Value> pValue);
CJS_Value(CJS_Runtime* pRuntime, int iValue);
CJS_Value(CJS_Runtime* pRuntime, double dValue);
CJS_Value(CJS_Runtime* pRuntime, bool bValue);
- CJS_Value(CJS_Runtime* pRuntime, CJS_Object* pObj);
+ explicit CJS_Value(CJS_Object* pObj);
CJS_Value(CJS_Runtime* pRuntime, const char* pStr);
CJS_Value(CJS_Runtime* pRuntime, const wchar_t* pWstr);
CJS_Value(CJS_Runtime* pRuntime, const CJS_Array& array);
- CJS_Value(CJS_Runtime* pRuntime, const CJS_Date& date);
- CJS_Value(CJS_Runtime* pRuntime, const CJS_Object* object);
+ explicit CJS_Value(const CJS_Date& date);
CJS_Value(const CJS_Value& other);
~CJS_Value();
// These calls may re-enter JS (and hence invalidate objects).
- void Set(CJS_Runtime* pRuntime, int val);
- void Set(CJS_Runtime* pRuntime, bool val);
- void Set(CJS_Runtime* pRuntime, double val);
- void Set(CJS_Runtime* pRuntime, CJS_Object* pObj);
- void Set(CJS_Runtime* pRuntime, CJS_Document* pJsDoc);
- void Set(CJS_Runtime* pRuntime, const ByteString&);
- void Set(CJS_Runtime* pRuntime, const WideString&);
- void Set(CJS_Runtime* pRuntime, const wchar_t* c_string);
- void Set(CJS_Runtime* pRuntime, const CJS_Array& array);
- void Set(CJS_Runtime* pRuntime, const CJS_Date& date);
- void Set(CJS_Runtime* pRuntime, v8::Local<v8::Value> pValue);
- void SetNull(CJS_Runtime* pRuntime);
+ void Set(v8::Local<v8::Value> pValue);
Type GetType() const { return GetValueType(m_pValue); }
@@ -70,12 +58,12 @@ class CJS_Value {
CJS_Object* ToObject(CJS_Runtime* pRuntime) const;
CJS_Document* ToDocument(CJS_Runtime* pRuntime) const;
CJS_Array ToArray(CJS_Runtime* pRuntime) const;
- CJS_Date ToDate(CJS_Runtime* pRuntime) const;
+ CJS_Date ToDate() const;
WideString ToWideString(CJS_Runtime* pRuntime) const;
ByteString ToByteString(CJS_Runtime* pRuntime) const;
v8::Local<v8::Object> ToV8Object(CJS_Runtime* pRuntime) const;
v8::Local<v8::Array> ToV8Array(CJS_Runtime* pRuntime) const;
- v8::Local<v8::Value> ToV8Value(CJS_Runtime* pRuntime) const;
+ v8::Local<v8::Value> ToV8Value() const;
// Replace the current |m_pValue| with a v8::Number if possible
// to make one from the current |m_pValue|.
@@ -133,7 +121,7 @@ class CJS_Date {
int GetMinutes(CJS_Runtime* pRuntime) const;
int GetSeconds(CJS_Runtime* pRuntime) const;
- v8::Local<v8::Date> ToV8Date(CJS_Runtime* pRuntime) const;
+ v8::Local<v8::Date> ToV8Date() const;
WideString ToWideString(int style) const;
protected: