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

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: VT_fxobject no longer used 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
Index: fpdfsdk/javascript/JS_Value.h
diff --git a/fpdfsdk/javascript/JS_Value.h b/fpdfsdk/javascript/JS_Value.h
index e8544504d20e28393fbe80eff74b4490a8b24f76..c48c789cdb4c723396ed10589fe32d5534a71264 100644
--- a/fpdfsdk/javascript/JS_Value.h
+++ b/fpdfsdk/javascript/JS_Value.h
@@ -27,13 +27,12 @@ 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);
@@ -49,11 +48,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 +66,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);
@@ -91,7 +90,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;
};

Powered by Google App Engine
This is Rietveld 408576698