Changeset 140927 in webkit
- Timestamp:
- Jan 27, 2013 2:58:30 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r140923 r140927 1 2013-01-27 Jochen Eisinger <jochen@chromium.org> 2 3 Check notification permissions in the show() method 4 https://bugs.webkit.org/show_bug.cgi?id=108009 5 6 Reviewed by Adam Barth. 7 8 * fast/notifications/notifications-constructor-with-permission-expected.txt: Added. 9 * fast/notifications/notifications-constructor-with-permission.html: Added. 10 * fast/notifications/notifications-constructor-without-permission-expected.txt: Added. 11 * fast/notifications/notifications-constructor-without-permission.html: Added. 12 1 13 2013-01-26 Sheriff Bot <webkit.review.bot@gmail.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r140925 r140927 1 2013-01-27 Jochen Eisinger <jochen@chromium.org> 2 3 Check notification permissions in the show() method 4 https://bugs.webkit.org/show_bug.cgi?id=108009 5 6 Reviewed by Adam Barth. 7 8 Tests: fast/notifications/notifications-constructor-with-permission.html 9 fast/notifications/notifications-constructor-without-permission.html 10 11 * Modules/notifications/Notification.cpp: 12 (WebCore::Notification::show): 13 (WebCore::Notification::taskTimerFired): 14 1 15 2013-01-26 Tony Chang <tony@chromium.org> 2 16 -
trunk/Source/WebCore/Modules/notifications/Notification.cpp
r128113 r140927 170 170 { 171 171 // prevent double-showing 172 if (m_state == Idle && m_notificationCenter->client() && m_notificationCenter->client()->show(this)) { 173 m_state = Showing; 174 setPendingActivity(this); 172 if (m_state == Idle && m_notificationCenter->client()) { 173 #if ENABLE(NOTIFICATIONS) 174 if (!static_cast<Document*>(scriptExecutionContext())->page()) 175 return; 176 if (NotificationController::from(static_cast<Document*>(scriptExecutionContext())->page())->client()->checkPermission(scriptExecutionContext()) != NotificationClient::PermissionAllowed) { 177 dispatchErrorEvent(); 178 return; 179 } 180 #endif 181 if (m_notificationCenter->client()->show(this)) { 182 m_state = Showing; 183 setPendingActivity(this); 184 } 175 185 } 176 186 } … … 241 251 { 242 252 ASSERT(scriptExecutionContext()->isDocument()); 243 ASSERT(static_cast<Document*>(scriptExecutionContext())->page());244 253 ASSERT_UNUSED(timer, timer == m_taskTimer.get()); 245 if (NotificationController::from(static_cast<Document*>(scriptExecutionContext())->page())->client()->checkPermission(scriptExecutionContext()) != NotificationClient::PermissionAllowed) {246 dispatchErrorEvent();247 return;248 }249 254 show(); 250 255 }
Note: See TracChangeset
for help on using the changeset viewer.