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

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

Issue 640803004: Add a basic DOMWindow base class and use it in WindowProxy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 years, 2 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/Frame.cpp ('k') | Source/core/frame/LocalFrame.h » ('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 10 matching lines...) Expand all
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
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/DOMWindowBase64.h" 32 #include "core/frame/DOMWindowBase64.h"
32 #include "core/frame/FrameDestructionObserver.h" 33 #include "core/frame/FrameDestructionObserver.h"
33 #include "platform/LifecycleContext.h" 34 #include "platform/LifecycleContext.h"
34 #include "platform/Supplementable.h" 35 #include "platform/Supplementable.h"
35 #include "platform/heap/Handle.h" 36 #include "platform/heap/Handle.h"
36 #include "platform/scroll/ScrollableArea.h" 37 #include "platform/scroll/ScrollableArea.h"
37 38
38 #include "wtf/Forward.h" 39 #include "wtf/Forward.h"
39 40
40 namespace blink { 41 namespace blink {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 77
77 typedef WillBeHeapVector<RefPtrWillBeMember<MessagePort>, 1> MessagePortArray; 78 typedef WillBeHeapVector<RefPtrWillBeMember<MessagePort>, 1> MessagePortArray;
78 79
79 enum PageshowEventPersistence { 80 enum PageshowEventPersistence {
80 PageshowEventNotPersisted = 0, 81 PageshowEventNotPersisted = 0,
81 PageshowEventPersisted = 1 82 PageshowEventPersisted = 1
82 }; 83 };
83 84
84 enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForw ardList }; 85 enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForw ardList };
85 86
86 class LocalDOMWindow final : public RefCountedWillBeGarbageCollectedFinalized<Lo calDOMWindow>, public EventTargetWithInlineData, public DOMWindowBase64, public FrameDestructionObserver, public WillBeHeapSupplementable<LocalDOMWindow>, publi c LifecycleContext<LocalDOMWindow> { 87 class LocalDOMWindow final : public RefCountedWillBeGarbageCollectedFinalized<Lo calDOMWindow>, public EventTargetWithInlineData, public DOMWindow, public DOMWin dowBase64, public FrameDestructionObserver, public WillBeHeapSupplementable<Loca lDOMWindow>, public LifecycleContext<LocalDOMWindow> {
87 DEFINE_WRAPPERTYPEINFO(); 88 DEFINE_WRAPPERTYPEINFO();
88 REFCOUNTED_EVENT_TARGET(LocalDOMWindow); 89 REFCOUNTED_EVENT_TARGET(LocalDOMWindow);
89 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalDOMWindow); 90 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalDOMWindow);
90 public: 91 public:
91 static PassRefPtrWillBeRawPtr<Document> createDocument(const String& mimeTyp e, const DocumentInit&, bool forceXHTML); 92 static PassRefPtrWillBeRawPtr<Document> createDocument(const String& mimeTyp e, const DocumentInit&, bool forceXHTML);
92 static PassRefPtrWillBeRawPtr<LocalDOMWindow> create(LocalFrame& frame) 93 static PassRefPtrWillBeRawPtr<LocalDOMWindow> create(LocalFrame& frame)
93 { 94 {
94 return adoptRefWillBeNoop(new LocalDOMWindow(frame)); 95 return adoptRefWillBeNoop(new LocalDOMWindow(frame));
95 } 96 }
96 virtual ~LocalDOMWindow(); 97 virtual ~LocalDOMWindow();
97 98
98 PassRefPtrWillBeRawPtr<Document> installNewDocument(const String& mimeType, const DocumentInit&, bool forceXHTML = false); 99 PassRefPtrWillBeRawPtr<Document> installNewDocument(const String& mimeType, const DocumentInit&, bool forceXHTML = false);
99 100
101 // EventTarget overrides:
100 virtual const AtomicString& interfaceName() const override; 102 virtual const AtomicString& interfaceName() const override;
101 virtual ExecutionContext* executionContext() const override; 103 virtual ExecutionContext* executionContext() const override;
104 virtual LocalDOMWindow* toDOMWindow() override;
102 105
103 virtual LocalDOMWindow* toDOMWindow() override; 106 // DOMWindow overrides:
107 ScriptWrappable* toScriptWrappable() override { return this; }
104 108
105 void registerProperty(DOMWindowProperty*); 109 void registerProperty(DOMWindowProperty*);
106 void unregisterProperty(DOMWindowProperty*); 110 void unregisterProperty(DOMWindowProperty*);
107 111
108 void reset(); 112 void reset();
109 113
110 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&); 114 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&);
111 115
112 unsigned pendingUnloadEventListeners() const; 116 unsigned pendingUnloadEventListeners() const;
113 117
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 } 403 }
400 404
401 inline String LocalDOMWindow::defaultStatus() const 405 inline String LocalDOMWindow::defaultStatus() const
402 { 406 {
403 return m_defaultStatus; 407 return m_defaultStatus;
404 } 408 }
405 409
406 } // namespace blink 410 } // namespace blink
407 411
408 #endif // LocalDOMWindow_h 412 #endif // LocalDOMWindow_h
OLDNEW
« no previous file with comments | « Source/core/frame/Frame.cpp ('k') | Source/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698