diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-26 09:28:59 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-26 17:14:48 +0000 |
commit | 3a1ba8efdbfffad723646dd878e6ca511f9f75bd (patch) | |
tree | 3d025f32729479faa9628668cac0654f13e45a37 /fpdfsdk/javascript/JS_Value.cpp | |
parent | 8b6acddd1e25dd48582f954ea9e67861dbd4f50f (diff) | |
download | pdfium-3a1ba8efdbfffad723646dd878e6ca511f9f75bd.tar.xz |
Remove CJS_Array
This CL removes the CJS_Array wrapper and uses the v8 objects directly.
Change-Id: I904f76e59e27d65db4b4d0bbd503fddb3e8cfc6f
Reviewed-on: https://pdfium-review.googlesource.com/16830
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/JS_Value.cpp')
-rw-r--r-- | fpdfsdk/javascript/JS_Value.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp index dee06e62f3..fdc8b87725 100644 --- a/fpdfsdk/javascript/JS_Value.cpp +++ b/fpdfsdk/javascript/JS_Value.cpp @@ -179,36 +179,6 @@ CJS_Return::CJS_Return(const CJS_Return&) = default; CJS_Return::~CJS_Return() = default; -CJS_Array::CJS_Array() {} - -CJS_Array::CJS_Array(v8::Local<v8::Array> pArray) : m_pArray(pArray) {} - -CJS_Array::CJS_Array(const CJS_Array& other) = default; - -CJS_Array::~CJS_Array() {} - -v8::Local<v8::Value> CJS_Array::GetElement(CJS_Runtime* pRuntime, - unsigned index) const { - if (!m_pArray.IsEmpty()) - return {pRuntime->GetArrayElement(m_pArray, index)}; - return {}; -} - -void CJS_Array::SetElement(CJS_Runtime* pRuntime, - unsigned index, - v8::Local<v8::Value> value) { - if (m_pArray.IsEmpty()) - m_pArray = pRuntime->NewArray(); - - pRuntime->PutArrayElement(m_pArray, index, value); -} - -int CJS_Array::GetLength(CJS_Runtime* pRuntime) const { - if (m_pArray.IsEmpty()) - return 0; - return pRuntime->GetArrayLength(m_pArray); -} - double JS_GetDateTime() { if (!FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) return 0; |