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

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

Issue 2015003002: Disallow local/remote checks on subclasses of Frame, FrameOwner and DOMWindow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pure virtual Created 4 years, 6 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 10
11 namespace blink { 11 namespace blink {
12 12
13 class RemoteDOMWindow final : public DOMWindow { 13 class RemoteDOMWindow final : public DOMWindow {
14 public: 14 public:
15 static RemoteDOMWindow* create(RemoteFrame& frame) 15 static RemoteDOMWindow* create(RemoteFrame& frame)
16 { 16 {
17 return new RemoteDOMWindow(frame); 17 return new RemoteDOMWindow(frame);
18 } 18 }
19 19
20 // EventTarget overrides: 20 // EventTarget overrides:
21 ExecutionContext* getExecutionContext() const override; 21 ExecutionContext* getExecutionContext() const override;
22 22
23 // DOMWindow overrides: 23 // DOMWindow overrides:
24 DECLARE_VIRTUAL_TRACE(); 24 DECLARE_VIRTUAL_TRACE();
25 bool isRemoteDOMWindow() const override { return true; }
26 RemoteFrame* frame() const override; 25 RemoteFrame* frame() const override;
27 Screen* screen() const override; 26 Screen* screen() const override;
28 History* history() const override; 27 History* history() const override;
29 BarProp* locationbar() const override; 28 BarProp* locationbar() const override;
30 BarProp* menubar() const override; 29 BarProp* menubar() const override;
31 BarProp* personalbar() const override; 30 BarProp* personalbar() const override;
32 BarProp* scrollbars() const override; 31 BarProp* scrollbars() const override;
33 BarProp* statusbar() const override; 32 BarProp* statusbar() const override;
34 BarProp* toolbar() const override; 33 BarProp* toolbar() const override;
35 Navigator* navigator() const override; 34 Navigator* navigator() const override;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 80
82 void frameDetached(); 81 void frameDetached();
83 82
84 protected: 83 protected:
85 // Protected DOMWindow overrides: 84 // Protected DOMWindow overrides:
86 void schedulePostMessage(MessageEvent*, PassRefPtr<SecurityOrigin> target, D ocument* source) override; 85 void schedulePostMessage(MessageEvent*, PassRefPtr<SecurityOrigin> target, D ocument* source) override;
87 86
88 private: 87 private:
89 explicit RemoteDOMWindow(RemoteFrame&); 88 explicit RemoteDOMWindow(RemoteFrame&);
90 89
90 // Intentionally private to prevent redundant checks when the type is
91 // already RemoteDOMWindow.
92 bool isLocalDOMWindow() const override { return false; }
93 bool isRemoteDOMWindow() const override { return true; }
94
91 Member<RemoteFrame> m_frame; 95 Member<RemoteFrame> m_frame;
92 }; 96 };
93 97
94 } // namespace blink 98 } // namespace blink
95 99
96 #endif // DOMWindow_h 100 #endif // DOMWindow_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.h ('k') | third_party/WebKit/Source/core/frame/RemoteFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698