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

Unified Diff: Source/web/WebNotification.cpp

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/notifications/Notification.idl ('k') | public/web/WebNotification.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebNotification.cpp
diff --git a/Source/web/WebNotification.cpp b/Source/web/WebNotification.cpp
index bc0f462f4f0d272bae2d91d1a7fe7371c341b6bc..ab79a0361724f61b2df4b5a748b5c0b22645e9ce 100644
--- a/Source/web/WebNotification.cpp
+++ b/Source/web/WebNotification.cpp
@@ -111,39 +111,24 @@ void WebNotification::detachPresenter()
void WebNotification::dispatchDisplayEvent()
{
-#if ENABLE(LEGACY_NOTIFICATIONS)
- dispatchEvent("display");
-#endif
- dispatchEvent("show");
+ m_private->dispatchShowEvent();
haraken 2013/08/16 14:58:03 Don't you need to check m_private->scriptExecution
kouhei (in TOK) 2013/08/20 00:58:56 True, but I don't understand why it is needed. It
haraken 2013/08/20 02:50:21 The check is needed because it's possible that not
kouhei (in TOK) 2013/08/22 03:18:47 I'll keep this check in this CL, and will do a sep
}
void WebNotification::dispatchErrorEvent(const WebKit::WebString& /* errorMessage */)
{
// FIXME: errorMessage not supported by WebCore yet
- dispatchEvent(eventNames().errorEvent);
+ m_private->dispatchErrorEvent();
}
void WebNotification::dispatchCloseEvent(bool /* byUser */)
{
// FIXME: byUser flag not supported by WebCore yet
- dispatchEvent(eventNames().closeEvent);
+ m_private->dispatchCloseEvent();
}
void WebNotification::dispatchClickEvent()
{
- UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
- WindowFocusAllowedIndicator windowFocusAllowed;
- dispatchEvent(eventNames().clickEvent);
-}
-
-void WebNotification::dispatchEvent(const WTF::AtomicString& type)
-{
- // Do not dispatch if the context is gone.
- if (!m_private->scriptExecutionContext())
- return;
-
- RefPtr<Event> event = Event::create(type, false, true);
- m_private->dispatchEvent(event.release());
+ m_private->dispatchClickEvent();
}
WebNotification::WebNotification(const WTF::PassRefPtr<Notification>& notification)
« no previous file with comments | « Source/modules/notifications/Notification.idl ('k') | public/web/WebNotification.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698