diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-04-25 12:43:13 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-25 20:31:57 +0000 |
commit | 80547a165adf250f31ade57544771201bbc2690c (patch) | |
tree | 1c1669fdcbc6d2fc443172142b80c03cd1a4972a /fxjs/cfxjse_context.h | |
parent | 233360e3ea0d6d4acea76a7d9e7ce7700ea80b1a (diff) | |
download | pdfium-80547a165adf250f31ade57544771201bbc2690c.tar.xz |
Use unique_ptr in CXFA_ScriptContext::m_mapVariableToContext.
Remove unused CFXJSE_Arguments::GetRuntime().
Remove some default argument values.
Make members of CFXJSE_Context private.
Change-Id: Id21951f7d8d68929b2799a9d6a2cdd7a3677f52a
Reviewed-on: https://pdfium-review.googlesource.com/4493
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_context.h')
-rw-r--r-- | fxjs/cfxjse_context.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fxjs/cfxjse_context.h b/fxjs/cfxjse_context.h index 7b83aee4aa..35d5b59cea 100644 --- a/fxjs/cfxjse_context.h +++ b/fxjs/cfxjse_context.h @@ -20,28 +20,29 @@ struct FXJSE_CLASS_DESCRIPTOR; class CFXJSE_Context { public: - static CFXJSE_Context* Create( + static std::unique_ptr<CFXJSE_Context> Create( v8::Isolate* pIsolate, - const FXJSE_CLASS_DESCRIPTOR* lpGlobalClass = nullptr, - CFXJSE_HostObject* lpGlobalObject = nullptr); + const FXJSE_CLASS_DESCRIPTOR* pGlobalClass, + CFXJSE_HostObject* pGlobalObject); + explicit CFXJSE_Context(v8::Isolate* pIsolate); ~CFXJSE_Context(); - v8::Isolate* GetRuntime() { return m_pIsolate; } + v8::Isolate* GetIsolate() const { return m_pIsolate; } + v8::Local<v8::Context> GetContext(); std::unique_ptr<CFXJSE_Value> GetGlobalObject(); + void AddClass(std::unique_ptr<CFXJSE_Class> pClass); + CFXJSE_Class* GetClassByName(const CFX_ByteStringC& szName) const; void EnableCompatibleMode(); bool ExecuteScript(const char* szScript, CFXJSE_Value* lpRetValue, CFXJSE_Value* lpNewThisObject = nullptr); protected: - friend class CFXJSE_Class; friend class CFXJSE_ScopeUtil_IsolateHandleContext; CFXJSE_Context(); CFXJSE_Context(const CFXJSE_Context&); - explicit CFXJSE_Context(v8::Isolate* pIsolate); - CFXJSE_Context& operator=(const CFXJSE_Context&); v8::Global<v8::Context> m_hContext; |