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

Unified Diff: Source/WebCore/page/DOMWindow.cpp

Issue 8333006: Merge 97667 - Re-landing: window.webkitNotifications uses deallocated NotificationPresenter after... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/page/DOMWindow.h ('k') | Source/WebCore/page/Frame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/page/DOMWindow.cpp
===================================================================
--- Source/WebCore/page/DOMWindow.cpp (revision 97673)
+++ Source/WebCore/page/DOMWindow.cpp (working copy)
@@ -548,9 +548,7 @@
#endif
#if ENABLE(NOTIFICATIONS)
- if (m_notifications)
- m_notifications->disconnectFrame();
- m_notifications = 0;
+ resetNotifications();
#endif
#if ENABLE(INDEXED_DATABASE)
@@ -758,6 +756,14 @@
return m_notifications.get();
}
+
+void DOMWindow::resetNotifications()
+{
+ if (!m_notifications)
+ return;
+ m_notifications->disconnectFrame();
+ m_notifications = 0;
+}
#endif
void DOMWindow::pageDestroyed()
@@ -766,9 +772,7 @@
#if ENABLE(NOTIFICATIONS)
// Clearing Notifications requests involves accessing the client so it must be done
// before the frame is detached.
- if (m_notifications)
- m_notifications->disconnectFrame();
- m_notifications = 0;
+ resetNotifications();
#endif
}
« no previous file with comments | « Source/WebCore/page/DOMWindow.h ('k') | Source/WebCore/page/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698