Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: third_party/WebKit/Source/core/frame/RemoteDOMWindow.h

Issue 2626403002: Move Frame pointer to be held by DOMWindow base class. (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef RemoteDOMWindow_h 5 #ifndef RemoteDOMWindow_h
6 #define RemoteDOMWindow_h 6 #define RemoteDOMWindow_h
7 7
8 #include "core/frame/DOMWindow.h" 8 #include "core/frame/DOMWindow.h"
9 #include "core/frame/RemoteFrame.h" 9 #include "core/frame/RemoteFrame.h"
10 #include "wtf/Assertions.h" 10 #include "wtf/Assertions.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class RemoteDOMWindow final : public DOMWindow { 14 class RemoteDOMWindow final : public DOMWindow {
15 public: 15 public:
16 static RemoteDOMWindow* create(RemoteFrame& frame) { 16 static RemoteDOMWindow* create(RemoteFrame& frame) {
17 return new RemoteDOMWindow(frame); 17 return new RemoteDOMWindow(frame);
18 } 18 }
19 19
20 RemoteFrame* frame() const { return toRemoteFrame(DOMWindow::frame()); }
21
20 // EventTarget overrides: 22 // EventTarget overrides:
21 ExecutionContext* getExecutionContext() const override; 23 ExecutionContext* getExecutionContext() const override;
22 24
23 // DOMWindow overrides: 25 // DOMWindow overrides:
24 DECLARE_VIRTUAL_TRACE(); 26 DECLARE_VIRTUAL_TRACE();
25 RemoteFrame* frame() const override;
26 Screen* screen() const override; 27 Screen* screen() const override;
27 History* history() const override; 28 History* history() const override;
28 BarProp* locationbar() const override; 29 BarProp* locationbar() const override;
29 BarProp* menubar() const override; 30 BarProp* menubar() const override;
30 BarProp* personalbar() const override; 31 BarProp* personalbar() const override;
31 BarProp* scrollbars() const override; 32 BarProp* scrollbars() const override;
32 BarProp* statusbar() const override; 33 BarProp* statusbar() const override;
33 BarProp* toolbar() const override; 34 BarProp* toolbar() const override;
34 Navigator* navigator() const override; 35 Navigator* navigator() const override;
35 bool offscreenBuffering() const override; 36 bool offscreenBuffering() const override;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 PassRefPtr<SecurityOrigin> target, 100 PassRefPtr<SecurityOrigin> target,
100 Document* source) override; 101 Document* source) override;
101 102
102 private: 103 private:
103 explicit RemoteDOMWindow(RemoteFrame&); 104 explicit RemoteDOMWindow(RemoteFrame&);
104 105
105 // Intentionally private to prevent redundant checks when the type is 106 // Intentionally private to prevent redundant checks when the type is
106 // already RemoteDOMWindow. 107 // already RemoteDOMWindow.
107 bool isLocalDOMWindow() const override { return false; } 108 bool isLocalDOMWindow() const override { return false; }
108 bool isRemoteDOMWindow() const override { return true; } 109 bool isRemoteDOMWindow() const override { return true; }
109
110 Member<RemoteFrame> m_frame;
111 }; 110 };
112 111
113 DEFINE_TYPE_CASTS(RemoteDOMWindow, 112 DEFINE_TYPE_CASTS(RemoteDOMWindow,
114 DOMWindow, 113 DOMWindow,
115 x, 114 x,
116 x->isRemoteDOMWindow(), 115 x->isRemoteDOMWindow(),
117 x.isRemoteDOMWindow()); 116 x.isRemoteDOMWindow());
118 117
119 } // namespace blink 118 } // namespace blink
120 119
121 #endif // DOMWindow_h 120 #endif // DOMWindow_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698