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

Side by Side Diff: Source/core/frame/LocalDOMWindow.h

Issue 901663005: Revert r189385 "Remove LifecycleContext" and r189391, r189530, r189456 that block it (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/DOMWindowLifecycleObserver.cpp ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 11 matching lines...) Expand all
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #ifndef LocalDOMWindow_h 27 #ifndef LocalDOMWindow_h
28 #define LocalDOMWindow_h 28 #define LocalDOMWindow_h
29 29
30 #include "core/events/EventTarget.h" 30 #include "core/events/EventTarget.h"
31 #include "core/frame/DOMWindow.h" 31 #include "core/frame/DOMWindow.h"
32 #include "core/frame/DOMWindowLifecycleNotifier.h"
33 #include "core/frame/FrameDestructionObserver.h" 32 #include "core/frame/FrameDestructionObserver.h"
34 #include "core/frame/LocalFrame.h" 33 #include "core/frame/LocalFrame.h"
34 #include "platform/LifecycleContext.h"
35 #include "platform/Supplementable.h" 35 #include "platform/Supplementable.h"
36 #include "platform/heap/Handle.h" 36 #include "platform/heap/Handle.h"
37 37
38 #include "wtf/Assertions.h" 38 #include "wtf/Assertions.h"
39 #include "wtf/Forward.h" 39 #include "wtf/Forward.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class DOMWindowEventQueue; 43 class DOMWindowEventQueue;
44 class DOMWindowLifecycleNotifier;
44 class DOMWindowProperty; 45 class DOMWindowProperty;
45 class DocumentInit; 46 class DocumentInit;
46 class EventListener; 47 class EventListener;
47 class EventQueue; 48 class EventQueue;
48 class ExceptionState; 49 class ExceptionState;
49 class FrameConsole; 50 class FrameConsole;
50 class IntRect; 51 class IntRect;
51 class Page; 52 class Page;
52 class PostMessageTimer; 53 class PostMessageTimer;
53 class ScriptCallStack; 54 class ScriptCallStack;
54 class SecurityOrigin; 55 class SecurityOrigin;
55 56
56 enum PageshowEventPersistence { 57 enum PageshowEventPersistence {
57 PageshowEventNotPersisted = 0, 58 PageshowEventNotPersisted = 0,
58 PageshowEventPersisted = 1 59 PageshowEventPersisted = 1
59 }; 60 };
60 61
61 // Note: if you're thinking of returning something DOM-related by reference, 62 // Note: if you're thinking of returning something DOM-related by reference,
62 // please ping dcheng@chromium.org first. You probably don't want to do that. 63 // please ping dcheng@chromium.org first. You probably don't want to do that.
63 class LocalDOMWindow final : public DOMWindow, public WillBeHeapSupplementable<L ocalDOMWindow>, public DOMWindowLifecycleNotifier { 64 class LocalDOMWindow final : public DOMWindow, public WillBeHeapSupplementable<L ocalDOMWindow>, public LifecycleContext<LocalDOMWindow> {
64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalDOMWindow); 65 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalDOMWindow);
65 public: 66 public:
66 static PassRefPtrWillBeRawPtr<Document> createDocument(const String& mimeTyp e, const DocumentInit&, bool forceXHTML); 67 static PassRefPtrWillBeRawPtr<Document> createDocument(const String& mimeTyp e, const DocumentInit&, bool forceXHTML);
67 static PassRefPtrWillBeRawPtr<LocalDOMWindow> create(LocalFrame& frame) 68 static PassRefPtrWillBeRawPtr<LocalDOMWindow> create(LocalFrame& frame)
68 { 69 {
69 return adoptRefWillBeNoop(new LocalDOMWindow(frame)); 70 return adoptRefWillBeNoop(new LocalDOMWindow(frame));
70 } 71 }
71 virtual ~LocalDOMWindow(); 72 virtual ~LocalDOMWindow();
72 73
73 PassRefPtrWillBeRawPtr<Document> installNewDocument(const String& mimeType, const DocumentInit&, bool forceXHTML = false); 74 PassRefPtrWillBeRawPtr<Document> installNewDocument(const String& mimeType, const DocumentInit&, bool forceXHTML = false);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 ApplicationCache* optionalApplicationCache() const { return m_applicationCac he.get(); } 192 ApplicationCache* optionalApplicationCache() const { return m_applicationCac he.get(); }
192 193
193 // Dispatch the (deprecated) orientationchange event to this DOMWindow and 194 // Dispatch the (deprecated) orientationchange event to this DOMWindow and
194 // recurse on its child frames. 195 // recurse on its child frames.
195 void sendOrientationChangeEvent(); 196 void sendOrientationChangeEvent();
196 197
197 void willDetachDocumentFromFrame(); 198 void willDetachDocumentFromFrame();
198 199
199 bool isInsecureScriptAccess(DOMWindow& callingWindow, const String& urlStrin g) override; 200 bool isInsecureScriptAccess(DOMWindow& callingWindow, const String& urlStrin g) override;
200 201
202 PassOwnPtr<LifecycleNotifier<LocalDOMWindow>> createLifecycleNotifier();
203
201 EventQueue* eventQueue() const; 204 EventQueue* eventQueue() const;
202 void enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event>); 205 void enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event>);
203 void enqueueDocumentEvent(PassRefPtrWillBeRawPtr<Event>); 206 void enqueueDocumentEvent(PassRefPtrWillBeRawPtr<Event>);
204 void enqueuePageshowEvent(PageshowEventPersistence); 207 void enqueuePageshowEvent(PageshowEventPersistence);
205 void enqueueHashchangeEvent(const String& oldURL, const String& newURL); 208 void enqueueHashchangeEvent(const String& oldURL, const String& newURL);
206 void enqueuePopstateEvent(PassRefPtr<SerializedScriptValue>); 209 void enqueuePopstateEvent(PassRefPtr<SerializedScriptValue>);
207 void dispatchWindowLoadEvent(); 210 void dispatchWindowLoadEvent();
208 void documentWasClosed(); 211 void documentWasClosed();
209 void statePopped(PassRefPtr<SerializedScriptValue>); 212 void statePopped(PassRefPtr<SerializedScriptValue>);
210 213
211 // FIXME: This shouldn't be public once LocalDOMWindow becomes ExecutionCont ext. 214 // FIXME: This shouldn't be public once LocalDOMWindow becomes ExecutionCont ext.
212 void clearEventQueue(); 215 void clearEventQueue();
213 216
214 void acceptLanguagesChanged(); 217 void acceptLanguagesChanged();
215 218
216 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext, v8::Isolate*) override; 219 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext, v8::Isolate*) override;
217 220
221 protected:
222 DOMWindowLifecycleNotifier& lifecycleNotifier();
223
218 private: 224 private:
219 // Rather than simply inheriting FrameDestructionObserver like most other 225 // Rather than simply inheriting FrameDestructionObserver like most other
220 // classes, LocalDOMWindow hides its FrameDestructionObserver with 226 // classes, LocalDOMWindow hides its FrameDestructionObserver with
221 // composition. This prevents conflicting overloads between DOMWindow, which 227 // composition. This prevents conflicting overloads between DOMWindow, which
222 // has a frame() accessor that returns Frame* for bindings code, and 228 // has a frame() accessor that returns Frame* for bindings code, and
223 // FrameDestructionObserver, which has a frame() accessor that returns a 229 // FrameDestructionObserver, which has a frame() accessor that returns a
224 // LocalFrame*. 230 // LocalFrame*.
225 class WindowFrameObserver final : public NoBaseWillBeGarbageCollected<Window FrameObserver>, public FrameDestructionObserver { 231 class WindowFrameObserver final : public NoBaseWillBeGarbageCollected<Window FrameObserver>, public FrameDestructionObserver {
226 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; 232 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
227 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WindowFrameObserver); 233 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WindowFrameObserver);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 313 }
308 314
309 inline String LocalDOMWindow::defaultStatus() const 315 inline String LocalDOMWindow::defaultStatus() const
310 { 316 {
311 return m_defaultStatus; 317 return m_defaultStatus;
312 } 318 }
313 319
314 } // namespace blink 320 } // namespace blink
315 321
316 #endif // LocalDOMWindow_h 322 #endif // LocalDOMWindow_h
OLDNEW
« no previous file with comments | « Source/core/frame/DOMWindowLifecycleObserver.cpp ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698