diff options
-rw-r--r-- | xfa/fxjse/context.h | 1 | ||||
-rw-r--r-- | xfa/fxjse/scope_inline.h | 75 |
2 files changed, 23 insertions, 53 deletions
diff --git a/xfa/fxjse/context.h b/xfa/fxjse/context.h index e475752dad..6737619511 100644 --- a/xfa/fxjse/context.h +++ b/xfa/fxjse/context.h @@ -44,7 +44,6 @@ class CFXJSE_Context { friend class CFXJSE_Class; friend class CFXJSE_ScopeUtil_IsolateHandleContext; - friend class CFXJSE_ScopeUtil_IsolateHandleRootOrNormalContext; }; v8::Local<v8::Object> FXJSE_CreateReturnValue(v8::Isolate* pIsolate, diff --git a/xfa/fxjse/scope_inline.h b/xfa/fxjse/scope_inline.h index 8eeda5c949..90b20fc3d0 100644 --- a/xfa/fxjse/scope_inline.h +++ b/xfa/fxjse/scope_inline.h @@ -11,12 +11,6 @@ #include "xfa/fxjse/runtime.h" class CFXJSE_ScopeUtil_IsolateHandle { - protected: - v8::Isolate* m_isolate; - v8::Locker m_locker; - v8::Isolate::Scope m_iscope; - v8::HandleScope m_hscope; - public: explicit CFXJSE_ScopeUtil_IsolateHandle(v8::Isolate* pIsolate) : m_isolate(pIsolate), @@ -26,15 +20,19 @@ class CFXJSE_ScopeUtil_IsolateHandle { v8::Isolate* GetIsolate() { return m_isolate; } private: - CFXJSE_ScopeUtil_IsolateHandle(const CFXJSE_ScopeUtil_IsolateHandle&); - void operator=(const CFXJSE_ScopeUtil_IsolateHandle&); - void* operator new(size_t size); - void operator delete(void*, size_t); + CFXJSE_ScopeUtil_IsolateHandle(const CFXJSE_ScopeUtil_IsolateHandle&) = + delete; + void operator=(const CFXJSE_ScopeUtil_IsolateHandle&) = delete; + void* operator new(size_t size) = delete; + void operator delete(void*, size_t) = delete; + + v8::Isolate* m_isolate; + v8::Locker m_locker; + v8::Isolate::Scope m_iscope; + v8::HandleScope m_hscope; }; -class CFXJSE_ScopeUtil_IsolateHandleRootContext { - CFXJSE_ScopeUtil_IsolateHandle m_parent; - v8::Context::Scope m_cscope; +class CFXJSE_ScopeUtil_IsolateHandleRootContext { public: explicit CFXJSE_ScopeUtil_IsolateHandleRootContext(v8::Isolate* pIsolate) : m_parent(pIsolate), @@ -44,16 +42,16 @@ class CFXJSE_ScopeUtil_IsolateHandleRootContext { private: CFXJSE_ScopeUtil_IsolateHandleRootContext( - const CFXJSE_ScopeUtil_IsolateHandleRootContext&); - void operator=(const CFXJSE_ScopeUtil_IsolateHandleRootContext&); - void* operator new(size_t size); - void operator delete(void*, size_t); -}; -class CFXJSE_ScopeUtil_IsolateHandleContext { - CFXJSE_Context* m_context; + const CFXJSE_ScopeUtil_IsolateHandleRootContext&) = delete; + void operator=(const CFXJSE_ScopeUtil_IsolateHandleRootContext&) = delete; + void* operator new(size_t size) = delete; + void operator delete(void*, size_t) = delete; + CFXJSE_ScopeUtil_IsolateHandle m_parent; v8::Context::Scope m_cscope; +}; +class CFXJSE_ScopeUtil_IsolateHandleContext { public: explicit CFXJSE_ScopeUtil_IsolateHandleContext(CFXJSE_Context* pContext) : m_context(pContext), @@ -68,41 +66,14 @@ class CFXJSE_ScopeUtil_IsolateHandleContext { private: CFXJSE_ScopeUtil_IsolateHandleContext( - const CFXJSE_ScopeUtil_IsolateHandleContext&); - void operator=(const CFXJSE_ScopeUtil_IsolateHandleContext&); - void* operator new(size_t size); - void operator delete(void*, size_t); -}; -class CFXJSE_ScopeUtil_IsolateHandleRootOrNormalContext { + const CFXJSE_ScopeUtil_IsolateHandleContext&) = delete; + void operator=(const CFXJSE_ScopeUtil_IsolateHandleContext&) = delete; + void* operator new(size_t size) = delete; + void operator delete(void*, size_t) = delete; + CFXJSE_Context* m_context; CFXJSE_ScopeUtil_IsolateHandle m_parent; v8::Context::Scope m_cscope; - - public: - explicit CFXJSE_ScopeUtil_IsolateHandleRootOrNormalContext( - v8::Isolate* pIsolate, - CFXJSE_Context* pContext) - : m_context(pContext), - m_parent(pIsolate), - m_cscope(v8::Local<v8::Context>::New( - pIsolate, - pContext ? pContext->m_hContext - : CFXJSE_RuntimeData::Get(pIsolate)->m_hRootContext)) {} - v8::Isolate* GetIsolate() { return m_parent.GetIsolate(); } - v8::Local<v8::Context> GetLocalContext() { - v8::Isolate* pIsolate = m_parent.GetIsolate(); - return v8::Local<v8::Context>::New( - pIsolate, m_context - ? m_context->m_hContext - : CFXJSE_RuntimeData::Get(pIsolate)->m_hRootContext); - } - - private: - CFXJSE_ScopeUtil_IsolateHandleRootOrNormalContext( - const CFXJSE_ScopeUtil_IsolateHandleRootOrNormalContext&); - void operator=(const CFXJSE_ScopeUtil_IsolateHandleRootOrNormalContext&); - void* operator new(size_t size); - void operator delete(void*, size_t); }; #endif // XFA_FXJSE_SCOPE_INLINE_H_ |