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

Unified Diff: Source/WebCore/Modules/notifications/Notification.cpp

Issue 12087048: Merge 140927 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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 | « LayoutTests/fast/notifications/notifications-constructor-without-permission-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/Modules/notifications/Notification.cpp
===================================================================
--- Source/WebCore/Modules/notifications/Notification.cpp (revision 141068)
+++ Source/WebCore/Modules/notifications/Notification.cpp (working copy)
@@ -169,9 +169,19 @@
void Notification::show()
{
// prevent double-showing
- if (m_state == Idle && m_notificationCenter->client() && m_notificationCenter->client()->show(this)) {
- m_state = Showing;
- setPendingActivity(this);
+ if (m_state == Idle && m_notificationCenter->client()) {
+#if ENABLE(NOTIFICATIONS)
+ if (!static_cast<Document*>(scriptExecutionContext())->page())
+ return;
+ if (NotificationController::from(static_cast<Document*>(scriptExecutionContext())->page())->client()->checkPermission(scriptExecutionContext()) != NotificationClient::PermissionAllowed) {
+ dispatchErrorEvent();
+ return;
+ }
+#endif
+ if (m_notificationCenter->client()->show(this)) {
+ m_state = Showing;
+ setPendingActivity(this);
+ }
}
}
@@ -240,12 +250,7 @@
void Notification::taskTimerFired(Timer<Notification>* timer)
{
ASSERT(scriptExecutionContext()->isDocument());
- ASSERT(static_cast<Document*>(scriptExecutionContext())->page());
ASSERT_UNUSED(timer, timer == m_taskTimer.get());
- if (NotificationController::from(static_cast<Document*>(scriptExecutionContext())->page())->client()->checkPermission(scriptExecutionContext()) != NotificationClient::PermissionAllowed) {
- dispatchErrorEvent();
- return;
- }
show();
}
#endif
« no previous file with comments | « LayoutTests/fast/notifications/notifications-constructor-without-permission-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698