summaryrefslogtreecommitdiff
path: root/fxjs/cjs_runtime.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-06 18:30:15 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-06 18:30:15 +0000
commitddaa40fe873070d3aae9a21b9a93848fc7e809f1 (patch)
tree222d228484da9e234a647254440e9aff98dca224 /fxjs/cjs_runtime.cpp
parent5caa34c64382d8587a3ec3de5edbb30976b1390d (diff)
downloadpdfium-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_runtime.cpp')
-rw-r--r--fxjs/cjs_runtime.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/fxjs/cjs_runtime.cpp b/fxjs/cjs_runtime.cpp
index a8640eaa34..2896c5f701 100644
--- a/fxjs/cjs_runtime.cpp
+++ b/fxjs/cjs_runtime.cpp
@@ -168,14 +168,12 @@ void CJS_Runtime::SetFormFillEnvToDocument() {
v8::Context::Scope context_scope(context);
v8::Local<v8::Object> pThis = GetThisObj();
- if (pThis.IsEmpty())
+ if (pThis.IsEmpty() ||
+ CFXJS_Engine::GetObjDefnID(pThis) != CJS_Document::GetObjDefnID()) {
return;
-
- if (CFXJS_Engine::GetObjDefnID(pThis) != CJS_Document::GetObjDefnID())
- return;
-
- CJS_Document* pJSDocument =
- static_cast<CJS_Document*>(GetObjectPrivate(pThis));
+ }
+ auto* pJSDocument =
+ static_cast<CJS_Document*>(CFXJS_Engine::GetObjectPrivate(pThis));
if (!pJSDocument)
return;