Changeset 249156 in webkit
- Timestamp:
- Aug 27, 2019, 11:38:41 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/notifications/request-in-detached-frame-expected.txt (added)
-
LayoutTests/http/tests/notifications/request-in-detached-frame.html (added)
-
LayoutTests/http/tests/notifications/resources/request-in-detached-frame-subframe.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/notifications/Notification.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r249153 r249156 1 2019-08-27 Chris Dumez <cdumez@apple.com> 2 3 Crash under WebCore::jsNotificationConstructorPermission 4 https://bugs.webkit.org/show_bug.cgi?id=201186 5 <rdar://problem/53962833> 6 7 Reviewed by Youenn Fablet. 8 9 Add layout test coverage. 10 11 * http/tests/notifications/request-in-detached-frame-expected.txt: Added. 12 * http/tests/notifications/request-in-detached-frame.html: Added. 13 * http/tests/notifications/resources/request-in-detached-frame-subframe.html: Added. 14 1 15 2019-08-27 Ryan Haddad <ryanhaddad@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r249154 r249156 1 2019-08-27 Chris Dumez <cdumez@apple.com> 2 3 Crash under WebCore::jsNotificationConstructorPermission 4 https://bugs.webkit.org/show_bug.cgi?id=201186 5 <rdar://problem/53962833> 6 7 Reviewed by Youenn Fablet. 8 9 Update the Notification API implementation to null-check the page before using. The page becomes null 10 when using the API in a frame that gets detached from its parent while in the middle of running 11 script. 12 13 Test: http/tests/notifications/request-in-detached-frame.html 14 15 * Modules/notifications/Notification.cpp: 16 (WebCore::Notification::permission): 17 (WebCore::Notification::requestPermission): 18 1 19 2019-08-27 Youenn Fablet <youenn@apple.com> 2 20 -
trunk/Source/WebCore/Modules/notifications/Notification.cpp
r248846 r249156 167 167 auto Notification::permission(Document& document) -> Permission 168 168 { 169 auto* page = document.page(); 170 if (!page) 171 return Permission::Default; 172 169 173 return NotificationController::from(document.page())->client().checkPermission(&document); 170 174 } … … 172 176 void Notification::requestPermission(Document& document, RefPtr<NotificationPermissionCallback>&& callback) 173 177 { 174 NotificationController::from(document.page())->client().requestPermission(&document, WTFMove(callback)); 178 auto* page = document.page(); 179 if (!page) 180 return; 181 182 NotificationController::from(page)->client().requestPermission(&document, WTFMove(callback)); 175 183 } 176 184
Note:
See TracChangeset
for help on using the changeset viewer.