diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-06-06 18:30:15 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-06 18:30:15 +0000 |
commit | ddaa40fe873070d3aae9a21b9a93848fc7e809f1 (patch) | |
tree | 222d228484da9e234a647254440e9aff98dca224 /fxjs/cjs_field.cpp | |
parent | 5caa34c64382d8587a3ec3de5edbb30976b1390d (diff) | |
download | pdfium-ddaa40fe873070d3aae9a21b9a93848fc7e809f1.tar.xz |
Stop using some v8::Context slot to find runtime.
Instead, use the object binding's pointer. Puts the cart back
behind the horse.
Change-Id: I4c06ae991b871c6e90b0e6c70b69886addca2354
Reviewed-on: https://pdfium-review.googlesource.com/33630
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cjs_field.cpp')
-rw-r--r-- | fxjs/cjs_field.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp index 0a322477ec..cdbe0dfc4d 100644 --- a/fxjs/cjs_field.cpp +++ b/fxjs/cjs_field.cpp @@ -2279,10 +2279,8 @@ CJS_Return CJS_Field::buttonGetIcon( if (pObj.IsEmpty()) return CJS_Return(false); - CJS_Icon* pJS_Icon = static_cast<CJS_Icon*>(pRuntime->GetObjectPrivate(pObj)); - if (!pJS_Icon) - return CJS_Return(false); - return CJS_Return(pJS_Icon->ToV8Object()); + auto* pJS_Icon = static_cast<CJS_Icon*>(CFXJS_Engine::GetObjectPrivate(pObj)); + return pJS_Icon ? CJS_Return(pJS_Icon->ToV8Object()) : CJS_Return(false); } CJS_Return CJS_Field::buttonImportIcon( @@ -2399,8 +2397,8 @@ CJS_Return CJS_Field::getArray( if (pObj.IsEmpty()) return CJS_Return(false); - CJS_Field* pJSField = - static_cast<CJS_Field*>(pRuntime->GetObjectPrivate(pObj)); + auto* pJSField = + static_cast<CJS_Field*>(CFXJS_Engine::GetObjectPrivate(pObj)); pJSField->AttachField(m_pJSDoc, *pStr); pRuntime->PutArrayElement(FormFieldArray, j++, pJSField |