summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_formcalc_context.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-07-16 21:35:06 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-16 21:35:06 +0000
commit98b356a36bc9291a4f222d092afeeea0d5b5f379 (patch)
tree71fbda3964df30ef354afd36e3a9aba32978f762 /fxjs/cfxjse_formcalc_context.h
parent31781107f6bda92e732fed805f62e8512bc78149 (diff)
downloadpdfium-98b356a36bc9291a4f222d092afeeea0d5b5f379.tar.xz
Use UnownedPtr<> to v8::Isolates.
Isolates are long-lived, but this may catch a few things. Introduce CFX_V8IsolateDeleter for unique_ptr<v8::Isolate> usage. Fix Dispose()/SetIsolate(nullptr) ordering in cjs_runtime.cpp Remove one unused isolate member. Flip protected -> private in one place. Change-Id: I26cdd120f799192e93b0d9d04dcde8f348dc21f3 Reviewed-on: https://pdfium-review.googlesource.com/37931 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_formcalc_context.h')
-rw-r--r--fxjs/cfxjse_formcalc_context.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/fxjs/cfxjse_formcalc_context.h b/fxjs/cfxjse_formcalc_context.h
index 51e3178c13..052bba394a 100644
--- a/fxjs/cfxjse_formcalc_context.h
+++ b/fxjs/cfxjse_formcalc_context.h
@@ -10,6 +10,7 @@
#include <memory>
#include <vector>
+#include "core/fxcrt/unowned_ptr.h"
#include "fxjs/cfxjse_arguments.h"
#include "fxjs/cfxjse_context.h"
#include "xfa/fxfa/parser/xfa_resolvenode_rs.h"
@@ -423,7 +424,7 @@ class CFXJSE_FormCalcContext : public CFXJSE_HostObject {
void GlobalPropertyGetter(CFXJSE_Value* pValue);
private:
- v8::Isolate* GetScriptRuntime() const { return m_pIsolate; }
+ v8::Isolate* GetScriptRuntime() const { return m_pIsolate.Get(); }
CXFA_Document* GetDocument() const { return m_pDocument.Get(); }
void ThrowNoDefaultPropertyException(const ByteStringView& name) const;
@@ -436,7 +437,7 @@ class CFXJSE_FormCalcContext : public CFXJSE_HostObject {
void ThrowParamCountMismatchException(const WideString& method) const;
void ThrowException(const wchar_t* str, ...) const;
- v8::Isolate* m_pIsolate;
+ UnownedPtr<v8::Isolate> m_pIsolate;
CFXJSE_Class* m_pFMClass;
std::unique_ptr<CFXJSE_Value> m_pValue;
UnownedPtr<CXFA_Document> const m_pDocument;