OLD | NEW |
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 DOMWindow_h | 5 #ifndef DOMWindow_h |
6 #define DOMWindow_h | 6 #define DOMWindow_h |
7 | 7 |
8 #include "bindings/core/v8/Transferables.h" | 8 #include "bindings/core/v8/Transferables.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 class Location; | 34 class Location; |
35 class LocalDOMWindow; | 35 class LocalDOMWindow; |
36 class MessageEvent; | 36 class MessageEvent; |
37 class MediaQueryList; | 37 class MediaQueryList; |
38 class Navigator; | 38 class Navigator; |
39 class Screen; | 39 class Screen; |
40 class ScriptState; | 40 class ScriptState; |
41 class ScrollToOptions; | 41 class ScrollToOptions; |
42 class SerializedScriptValue; | 42 class SerializedScriptValue; |
43 class StyleMedia; | 43 class StyleMedia; |
| 44 class WindowProxyManagerBase; |
44 | 45 |
45 class CORE_EXPORT DOMWindow : public EventTargetWithInlineData, | 46 class CORE_EXPORT DOMWindow : public EventTargetWithInlineData, |
46 public DOMWindowBase64 { | 47 public DOMWindowBase64 { |
47 DEFINE_WRAPPERTYPEINFO(); | 48 DEFINE_WRAPPERTYPEINFO(); |
48 | 49 |
49 public: | 50 public: |
50 ~DOMWindow() override; | 51 ~DOMWindow() override; |
51 | 52 |
52 Frame* frame() const { | 53 Frame* frame() const { |
53 // If the DOMWindow still has a frame reference, that frame must point | 54 // If the DOMWindow still has a frame reference, that frame must point |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 112 |
112 virtual const AtomicString& name() const = 0; | 113 virtual const AtomicString& name() const = 0; |
113 virtual void setName(const AtomicString&) = 0; | 114 virtual void setName(const AtomicString&) = 0; |
114 | 115 |
115 virtual String status() const = 0; | 116 virtual String status() const = 0; |
116 virtual void setStatus(const String&) = 0; | 117 virtual void setStatus(const String&) = 0; |
117 virtual String defaultStatus() const = 0; | 118 virtual String defaultStatus() const = 0; |
118 virtual void setDefaultStatus(const String&) = 0; | 119 virtual void setDefaultStatus(const String&) = 0; |
119 | 120 |
120 // Self-referential attributes | 121 // Self-referential attributes |
121 v8::Local<v8::Object> self(ScriptState*) const; | 122 WindowProxyManagerBase* self() const; |
122 v8::Local<v8::Object> window(ScriptState* scriptState) const { | 123 WindowProxyManagerBase* window() const { return self(); } |
123 return self(scriptState); | 124 WindowProxyManagerBase* frames() const { return self(); } |
124 } | |
125 v8::Local<v8::Object> frames(ScriptState* scriptState) const { | |
126 return self(scriptState); | |
127 } | |
128 | 125 |
129 DOMWindow* opener() const; | 126 DOMWindow* opener() const; |
130 DOMWindow* parent() const; | 127 DOMWindow* parent() const; |
131 DOMWindow* top() const; | 128 DOMWindow* top() const; |
132 | 129 |
133 // DOM Level 2 AbstractView Interface | 130 // DOM Level 2 AbstractView Interface |
134 virtual Document* document() const = 0; | 131 virtual Document* document() const = 0; |
135 | 132 |
136 // CSSOM View Module | 133 // CSSOM View Module |
137 virtual StyleMedia* styleMedia() const = 0; | 134 virtual StyleMedia* styleMedia() const = 0; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 explicit DOMWindow(Frame&); | 261 explicit DOMWindow(Frame&); |
265 | 262 |
266 virtual void schedulePostMessage(MessageEvent*, | 263 virtual void schedulePostMessage(MessageEvent*, |
267 PassRefPtr<SecurityOrigin> target, | 264 PassRefPtr<SecurityOrigin> target, |
268 Document* source) = 0; | 265 Document* source) = 0; |
269 | 266 |
270 void disconnectFromFrame() { m_frame = nullptr; } | 267 void disconnectFromFrame() { m_frame = nullptr; } |
271 | 268 |
272 private: | 269 private: |
273 Member<Frame> m_frame; | 270 Member<Frame> m_frame; |
| 271 const Member<WindowProxyManagerBase> m_windowProxyManager; |
274 mutable Member<Location> m_location; | 272 mutable Member<Location> m_location; |
275 | 273 |
276 // Set to true when close() has been called. Needed for | 274 // Set to true when close() has been called. Needed for |
277 // |window.closed| determinism; having it return 'true' | 275 // |window.closed| determinism; having it return 'true' |
278 // only after the layout widget's deferred window close | 276 // only after the layout widget's deferred window close |
279 // operation has been performed, exposes (confusing) | 277 // operation has been performed, exposes (confusing) |
280 // implementation details to scripts. | 278 // implementation details to scripts. |
281 bool m_windowIsClosing; | 279 bool m_windowIsClosing; |
282 | 280 |
283 }; | 281 }; |
284 | 282 |
285 } // namespace blink | 283 } // namespace blink |
286 | 284 |
287 #endif // DOMWindow_h | 285 #endif // DOMWindow_h |
OLD | NEW |