summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/JS_Value.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-08-08 09:49:42 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-08 09:49:42 -0700
commite5aff74a43a2c3355a8b7699a47d0fb7f23b243e (patch)
treecaa9e0f3dffc91bfdf7b753171353b4ae9c5370a /fpdfsdk/javascript/JS_Value.h
parent660de3c494b68a574cb4cdf20359f51ddc260d3c (diff)
downloadpdfium-e5aff74a43a2c3355a8b7699a47d0fb7f23b243e.tar.xz
Remove backpointer to runtime from CJS_Array.
This is always available elsewhere, so save the bytes and ease removal of CJS_Array since it now only contains a single v8 local. Review-Url: https://codereview.chromium.org/2217253002
Diffstat (limited to 'fpdfsdk/javascript/JS_Value.h')
-rw-r--r--fpdfsdk/javascript/JS_Value.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/fpdfsdk/javascript/JS_Value.h b/fpdfsdk/javascript/JS_Value.h
index 01b4e5ba45..75c40a60a1 100644
--- a/fpdfsdk/javascript/JS_Value.h
+++ b/fpdfsdk/javascript/JS_Value.h
@@ -40,7 +40,7 @@ class CJS_Value {
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);
+ CJS_Value(CJS_Runtime* pRuntime, const CJS_Array& array);
CJS_Value(const CJS_Value& other);
~CJS_Value();
@@ -129,21 +129,23 @@ class CJS_PropValue : public CJS_Value {
class CJS_Array {
public:
- explicit CJS_Array(CJS_Runtime* pRuntime);
+ CJS_Array();
CJS_Array(const CJS_Array& other);
virtual ~CJS_Array();
void Attach(v8::Local<v8::Array> pArray);
- void GetElement(unsigned index, CJS_Value& value) const;
- void SetElement(unsigned index, CJS_Value value);
+ void GetElement(v8::Isolate* pIsolate,
+ unsigned index,
+ CJS_Value& value) const;
+ void SetElement(v8::Isolate* pIsolate,
+ unsigned index,
+ const CJS_Value& value);
int GetLength() const;
- v8::Local<v8::Array> ToV8Array() const;
- CJS_Runtime* GetJSRuntime() const { return m_pJSRuntime; }
+ v8::Local<v8::Array> ToV8Array(v8::Isolate* pIsolate) const;
private:
mutable v8::Local<v8::Array> m_pArray;
- CJS_Runtime* const m_pJSRuntime;
};
class CJS_Date {