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

Unified Diff: fpdfsdk/javascript/JS_Value.h

Issue 2154503002: Remove type info from CJS_Value, interrogate v8 instead (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: nit Created 4 years, 5 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/javascript/JS_Define.h ('k') | fpdfsdk/javascript/JS_Value.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/JS_Value.h
diff --git a/fpdfsdk/javascript/JS_Value.h b/fpdfsdk/javascript/JS_Value.h
index e8544504d20e28393fbe80eff74b4490a8b24f76..8e791253c61fd3af64312f7b7c2c27ac4b4ce4b5 100644
--- a/fpdfsdk/javascript/JS_Value.h
+++ b/fpdfsdk/javascript/JS_Value.h
@@ -27,20 +27,17 @@ class CJS_Value {
VT_boolean,
VT_date,
VT_object,
- VT_fxobject,
VT_null,
VT_undefined
};
CJS_Value(CJS_Runtime* pRuntime);
- CJS_Value(CJS_Runtime* pRuntime, v8::Local<v8::Value> pValue, Type t);
+ CJS_Value(CJS_Runtime* pRuntime, v8::Local<v8::Value> pValue);
CJS_Value(CJS_Runtime* pRuntime, const int& iValue);
CJS_Value(CJS_Runtime* pRuntime, const double& dValue);
CJS_Value(CJS_Runtime* pRuntime, const float& fValue);
CJS_Value(CJS_Runtime* pRuntime, const bool& bValue);
- CJS_Value(CJS_Runtime* pRuntime, v8::Local<v8::Object>);
- CJS_Value(CJS_Runtime* pRuntime, CJS_Object*);
- CJS_Value(CJS_Runtime* pRuntime, CJS_Document*);
+ CJS_Value(CJS_Runtime* pRuntime, CJS_Object* pObj);
CJS_Value(CJS_Runtime* pRuntime, const FX_CHAR* pStr);
CJS_Value(CJS_Runtime* pRuntime, const FX_WCHAR* pWstr);
CJS_Value(CJS_Runtime* pRuntime, CJS_Array& array);
@@ -49,11 +46,12 @@ class CJS_Value {
CJS_Value(const CJS_Value& other);
void SetNull();
- void Attach(v8::Local<v8::Value> pValue, Type t);
+ void Attach(v8::Local<v8::Value> pValue);
void Attach(CJS_Value* pValue);
void Detach();
- Type GetType() const;
+ static Type GetValueType(v8::Local<v8::Value> value);
+ Type GetType() const { return GetValueType(m_pValue); }
int ToInt() const;
bool ToBool() const;
double ToDouble() const;
@@ -66,8 +64,7 @@ class CJS_Value {
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|, updating |m_eType|
- // as appropriate to indicate the result.
+ // to make one from the current |m_pValue|.
void MaybeCoerceToNumber();
void operator=(int iValue);
@@ -75,7 +72,6 @@ class CJS_Value {
void operator=(double val);
void operator=(float val);
void operator=(CJS_Object* val);
- void operator=(CJS_Document* val);
void operator=(v8::Local<v8::Object> val);
void operator=(CJS_Array& val);
void operator=(CJS_Date& val);
@@ -91,7 +87,6 @@ class CJS_Value {
CJS_Runtime* GetJSRuntime() const { return m_pJSRuntime; }
protected:
- Type m_eType;
v8::Local<v8::Value> m_pValue;
CJS_Runtime* m_pJSRuntime;
};
« no previous file with comments | « fpdfsdk/javascript/JS_Define.h ('k') | fpdfsdk/javascript/JS_Value.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698