Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.h |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h b/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.h |
| similarity index 43% |
| copy from third_party/WebKit/Source/bindings/core/v8/WindowProxy.h |
| copy to third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.h |
| index 9f074f2b304169e795c11e78e0145236aa167b0a..f93c1822f4a8e95eff5cc628a50fc455a14d1dd3 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h |
| +++ b/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.h |
| @@ -28,104 +28,39 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#ifndef WindowProxy_h |
| -#define WindowProxy_h |
| +#ifndef RemoteWindowProxy_h |
| +#define RemoteWindowProxy_h |
| #include "bindings/core/v8/DOMWrapperWorld.h" |
| -#include "bindings/core/v8/ScopedPersistent.h" |
| -#include "bindings/core/v8/ScriptState.h" |
| -#include "platform/heap/Handle.h" |
| -#include "platform/weborigin/SecurityOrigin.h" |
| -#include "wtf/HashMap.h" |
| -#include "wtf/PassRefPtr.h" |
| -#include "wtf/RefPtr.h" |
| -#include "wtf/text/AtomicString.h" |
| +#include "core/frame/RemoteFrame.h" |
| #include <v8.h> |
| namespace blink { |
| -class Frame; |
| -class HTMLDocument; |
| -class SecurityOrigin; |
| - |
| -// WindowProxy represents all the per-global object state for a Frame that |
| -// persist between navigations. |
| -class WindowProxy final : public GarbageCollectedFinalized<WindowProxy> { |
| +// Subclass of WindowProxy that only handles RemoteFrame. |
| +class RemoteWindowProxy final : public WindowProxy { |
| public: |
| - static WindowProxy* create(v8::Isolate*, Frame*, DOMWrapperWorld&); |
| - |
| - ~WindowProxy(); |
| - DECLARE_TRACE(); |
| - |
| - v8::Local<v8::Context> contextIfInitialized() const { |
| - return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); |
| + static RemoteWindowProxy* create(RemoteFrame& frame, |
| + v8::Isolate* isolate, |
| + RefPtr<DOMWrapperWorld> world) { |
| + return new RemoteWindowProxy(frame, isolate, std::move(world)); |
| } |
| - ScriptState* getScriptState() const { return m_scriptState.get(); } |
| - |
| - // Update document object of the frame. |
| - void updateDocument(); |
| - |
| - void namedItemAdded(HTMLDocument*, const AtomicString&); |
| - void namedItemRemoved(HTMLDocument*, const AtomicString&); |
| - |
| - // Update the security origin of a document |
| - // (e.g., after setting docoument.domain). |
| - void updateSecurityOrigin(SecurityOrigin*); |
| - |
| - void initializeIfNeeded(); |
| - |
| - void clearForNavigation(); |
| - void clearForClose(); |
| - v8::Local<v8::Object> globalIfNotDetached(); |
| - v8::Local<v8::Object> releaseGlobal(); |
| - void setGlobal(v8::Local<v8::Object>); |
| - |
| - DOMWrapperWorld& world() { return *m_world; } |
| + ~RemoteWindowProxy() override; |
|
Yuki
2017/01/11 10:09:24
nit: "= default" should work, or we don't need thi
dcheng
2017/01/11 10:35:28
Done.
|
| private: |
| - // A valid transition is from ContextUninitialized to ContextInitialized, |
| - // and then ContextDetached. Other transitions are forbidden. |
| - enum class Lifecycle { |
| - ContextUninitialized, |
| - ContextInitialized, |
| - ContextDetached, |
| - }; |
| - |
| - WindowProxy(Frame*, PassRefPtr<DOMWrapperWorld>, v8::Isolate*); |
| - void initialize(); |
| + RemoteWindowProxy(RemoteFrame&, v8::Isolate*, RefPtr<DOMWrapperWorld>); |
| - enum GlobalDetachmentBehavior { DoNotDetachGlobal, DetachGlobal }; |
| + void initialize() override; |
| void disposeContext(GlobalDetachmentBehavior); |
|
Yuki
2017/01/11 10:09:24
nit: Add override;
dcheng
2017/01/11 10:35:28
Done.
|
| - void setSecurityToken(SecurityOrigin*); |
| - |
| - // The JavaScript wrapper for the document object is cached on the global |
| - // object for fast access. UpdateDocumentProperty sets the wrapper |
| - // for the current document on the global object. |
| - void updateDocumentProperty(); |
| - |
| - // Updates Activity Logger for the current context. |
| - void updateActivityLogger(); |
| - |
| // Creates a new v8::Context with the window wrapper object as the global |
| // object (aka the inner global). Note that the window wrapper and its |
| // prototype chain do not get fully initialized yet, e.g. the window |
| // wrapper is not yet associated with the native DOMWindow object. |
| void createContext(); |
| - |
| - // Associates the window wrapper and its prototype chain with the native |
| - // DOMWindow object. Also does some more Window-specific initialization. |
| - void setupWindowPrototypeChain(); |
| - |
| - Member<Frame> m_frame; |
| - v8::Isolate* m_isolate; |
| - RefPtr<ScriptState> m_scriptState; |
| - RefPtr<DOMWrapperWorld> m_world; |
| - ScopedPersistent<v8::Object> m_globalProxy; |
| - Lifecycle m_lifecycle; |
| }; |
| } // namespace blink |
| -#endif // WindowProxy_h |
| +#endif // RemoteWindowProxy_h |