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

Side by Side Diff: Source/modules/notifications/Notification.h

Issue 22909013: Notification should not leak document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add test expectation Created 7 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 15 matching lines...) Expand all
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #ifndef Notification_h 32 #ifndef Notification_h
33 #define Notification_h 33 #define Notification_h
34 34
35 #include "bindings/v8/ScriptWrappable.h" 35 #include "bindings/v8/ScriptWrappable.h"
36 #include "core/dom/ActiveDOMObject.h" 36 #include "core/dom/ContextLifecycleObserver.h"
37 #include "core/dom/EventNames.h" 37 #include "core/dom/EventNames.h"
38 #include "core/dom/EventTarget.h" 38 #include "core/dom/EventTarget.h"
39 #include "core/loader/ThreadableLoaderClient.h" 39 #include "core/loader/ThreadableLoaderClient.h"
40 #include "core/platform/SharedBuffer.h" 40 #include "core/platform/SharedBuffer.h"
41 #include "core/platform/text/TextDirection.h" 41 #include "core/platform/text/TextDirection.h"
42 #include "modules/notifications/NotificationClient.h" 42 #include "modules/notifications/NotificationClient.h"
43 #include "weborigin/KURL.h" 43 #include "weborigin/KURL.h"
44 #include "wtf/OwnPtr.h" 44 #include "wtf/OwnPtr.h"
45 #include "wtf/PassRefPtr.h" 45 #include "wtf/PassRefPtr.h"
46 #include "wtf/RefCounted.h" 46 #include "wtf/RefCounted.h"
47 #include "wtf/RefPtr.h" 47 #include "wtf/RefPtr.h"
48 #include "wtf/text/AtomicStringHash.h" 48 #include "wtf/text/AtomicStringHash.h"
49 49
50 #if ENABLE(NOTIFICATIONS) 50 #if ENABLE(NOTIFICATIONS)
51 #include "core/platform/Timer.h" 51 #include "core/platform/Timer.h"
52 #endif 52 #endif
53 53
54 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 54 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
55 namespace WebCore { 55 namespace WebCore {
56 56
57 class Dictionary; 57 class Dictionary;
58 class ExceptionState; 58 class ExceptionState;
59 class NotificationCenter; 59 class NotificationCenter;
60 class NotificationPermissionCallback; 60 class NotificationPermissionCallback;
61 class ResourceError; 61 class ResourceError;
62 class ResourceResponse; 62 class ResourceResponse;
63 class ScriptExecutionContext; 63 class ScriptExecutionContext;
64 class ThreadableLoader; 64 class ThreadableLoader;
65 65
66 class Notification : public RefCounted<Notification>, public ScriptWrappable, pu blic ActiveDOMObject, public EventTarget { 66 class Notification : public RefCounted<Notification>, public ScriptWrappable, pu blic ContextLifecycleObserver, public EventTarget {
67 WTF_MAKE_FAST_ALLOCATED; 67 WTF_MAKE_FAST_ALLOCATED;
68 public: 68 public:
69 Notification(); 69 Notification();
70 #if ENABLE(LEGACY_NOTIFICATIONS) 70 #if ENABLE(LEGACY_NOTIFICATIONS)
71 static PassRefPtr<Notification> create(const String& title, const String& bo dy, const String& iconURI, ScriptExecutionContext*, ExceptionState&, PassRefPtr< NotificationCenter> provider); 71 static PassRefPtr<Notification> create(const String& title, const String& bo dy, const String& iconURI, ScriptExecutionContext*, ExceptionState&, PassRefPtr< NotificationCenter> provider);
72 #endif 72 #endif
73 #if ENABLE(NOTIFICATIONS) 73 #if ENABLE(NOTIFICATIONS)
74 static PassRefPtr<Notification> create(ScriptExecutionContext*, const String & title, const Dictionary& options); 74 static PassRefPtr<Notification> create(ScriptExecutionContext*, const String & title, const Dictionary& options);
75 #endif 75 #endif
76 76
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void dispatchClickEvent(); 115 void dispatchClickEvent();
116 void dispatchCloseEvent(); 116 void dispatchCloseEvent();
117 void dispatchErrorEvent(); 117 void dispatchErrorEvent();
118 void dispatchShowEvent(); 118 void dispatchShowEvent();
119 119
120 using RefCounted<Notification>::ref; 120 using RefCounted<Notification>::ref;
121 using RefCounted<Notification>::deref; 121 using RefCounted<Notification>::deref;
122 122
123 // EventTarget interface 123 // EventTarget interface
124 virtual const AtomicString& interfaceName() const; 124 virtual const AtomicString& interfaceName() const;
125 virtual ScriptExecutionContext* scriptExecutionContext() const { return Acti veDOMObject::scriptExecutionContext(); } 125 virtual ScriptExecutionContext* scriptExecutionContext() const { return Cont extLifecycleObserver::scriptExecutionContext(); }
126 126
127 // ActiveDOMObject interface 127 // ContextLifecycleObserver interface
128 virtual void contextDestroyed(); 128 virtual void contextDestroyed();
129 129
130 void stopLoadingIcon(); 130 void stopLoadingIcon();
131 131
132 // Deprecated. Use functions from NotificationCenter. 132 // Deprecated. Use functions from NotificationCenter.
133 void detachPresenter() { } 133 void detachPresenter() { }
134 134
135 void finalize(); 135 void finalize();
136 136
137 #if ENABLE(NOTIFICATIONS) 137 #if ENABLE(NOTIFICATIONS)
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 #if ENABLE(NOTIFICATIONS) 187 #if ENABLE(NOTIFICATIONS)
188 OwnPtr<Timer<Notification> > m_taskTimer; 188 OwnPtr<Timer<Notification> > m_taskTimer;
189 #endif 189 #endif
190 }; 190 };
191 191
192 } // namespace WebCore 192 } // namespace WebCore
193 193
194 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 194 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
195 195
196 #endif // Notifications_h 196 #endif // Notifications_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698