Changeset 180871 in webkit
- Timestamp:
- Mar 1, 2015 4:08:03 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r180870 r180871 1 2015-03-01 Chris Dumez <cdumez@apple.com> 2 3 Make NotificationCenter / Notification suspendable 4 https://bugs.webkit.org/show_bug.cgi?id=142117 5 <rdar://problem/19923085> 6 7 Reviewed by Andreas Kling. 8 9 Add layout tests to cover cases where notifications should prevent 10 entering the PageCache or not. 11 12 * fast/history/page-cache-notification-non-suspendable-expected.txt: Added. 13 * fast/history/page-cache-notification-non-suspendable.html: Added. 14 * fast/history/page-cache-notification-suspendable-expected.txt: Added. 15 * fast/history/page-cache-notification-suspendable.html: Added. 16 * platform/efl/TestExpectations: 17 * platform/gtk/TestExpectations: 18 * platform/ios-simulator/TestExpectations: 19 * platform/win/TestExpectations: 20 * platform/wincairo/TestExpectations: 21 1 22 2015-03-01 Ryosuke Niwa <rniwa@webkit.org> 2 23 -
trunk/LayoutTests/platform/efl/TestExpectations
r180836 r180871 1075 1075 webkit.org/b/73544 fast/notifications [ Skip ] 1076 1076 webkit.org/b/73544 http/tests/notifications [ Skip ] 1077 webkit.org/b/73544 fast/history/page-cache-notification-non-suspendable.html [ Skip ] 1078 webkit.org/b/73544 fast/history/page-cache-notification-suspendable.html [ Skip ] 1077 1079 1078 1080 # The test is too slow on Debug bot and randomly fails -
trunk/LayoutTests/platform/gtk/TestExpectations
r180776 r180871 149 149 # https://bugs.webkit.org/show_bug.cgi?id=81697 Skip file:// based notifications tests 150 150 fast/notifications 151 fast/history/page-cache-notification-non-suspendable.html 152 fast/history/page-cache-notification-suspendable.html 151 153 152 154 # we do not enable legacy notifications -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r180811 r180871 27 27 printing 28 28 29 # Web Notifications are not supported on iOS. 30 fast/notifications 31 http/tests/notifications 32 fast/history/page-cache-notification-non-suspendable.html 33 fast/history/page-cache-notification-suspendable.html 34 29 35 # Not supported on iOS 30 36 batterystatus 31 37 fast/mediastream 32 fast/notifications33 38 fast/speechsynthesis 34 39 gamepad … … 39 44 vibration 40 45 webaudio 41 http/tests/notifications42 46 43 47 # ENABLE(MEDIA_CAPTURE) is not enabled -
trunk/LayoutTests/platform/win/TestExpectations
r180863 r180871 129 129 fast/notifications/ [ Skip ] 130 130 http/tests/notifications/ [ Skip ] 131 fast/history/page-cache-notification-non-suspendable.html [ Skip ] 132 fast/history/page-cache-notification-suspendable.html [ Skip ] 131 133 132 134 # TODO DumpRenderTree code to enable Java is currently a no-op. Windows doesn't come with Java by default. -
trunk/LayoutTests/platform/wincairo/TestExpectations
r180791 r180871 1334 1334 fast/notifications 1335 1335 http/tests/notifications 1336 fast/history/page-cache-notification-non-suspendable.html 1337 fast/history/page-cache-notification-suspendable.html 1336 1338 1337 1339 # These media tests regressed on the bots. Skipping to make the bots green again. -
trunk/Source/WebCore/ChangeLog
r180867 r180871 1 2015-03-01 Chris Dumez <cdumez@apple.com> 2 3 Make NotificationCenter / Notification suspendable 4 https://bugs.webkit.org/show_bug.cgi?id=142117 5 <rdar://problem/19923085> 6 7 Reviewed by Andreas Kling. 8 9 Make NotificationCenter / Notification suspendable so that pages using 10 them can enter the PageCache. 11 12 NotificationCenter can safely be suspended if there are no pending 13 permission requests. This required adding an 14 "hasPendingPermissionRequests()" callback to the NotificationClient. 15 16 Notification can safely be suspended if it is either idle (not showing 17 yet) or closed. 18 19 Tests: fast/history/page-cache-notification-non-suspendable.html 20 fast/history/page-cache-notification-suspendable.html 21 22 * Modules/notifications/Notification.cpp: 23 (WebCore::Notification::canSuspend): 24 * Modules/notifications/NotificationCenter.cpp: 25 (WebCore::NotificationCenter::canSuspend): 26 * Modules/notifications/NotificationClient.h: 27 1 28 2015-03-01 Ryosuke Niwa <rniwa@webkit.org> 2 29 -
trunk/Source/WebCore/Modules/notifications/Notification.cpp
r180801 r180871 178 178 bool Notification::canSuspend() const 179 179 { 180 // FIXME: We should try and do better here.181 return false;180 // We can suspend if the Notification is not shown yet or after it is closed. 181 return m_state == Idle || m_state == Closed; 182 182 } 183 183 -
trunk/Source/WebCore/Modules/notifications/NotificationCenter.cpp
r180801 r180871 113 113 bool NotificationCenter::canSuspend() const 114 114 { 115 // FIXME: We should try and do better here. 116 return false; 115 // We don't need to worry about Notifications because those are ActiveDOMObject too. 116 // The NotificationCenter can safely be suspended if there are no pending permission 117 // requests. 118 return m_callbacks.isEmpty() && (!m_client || !m_client->hasPendingPermissionRequests(scriptExecutionContext())); 117 119 } 118 120 -
trunk/Source/WebCore/Modules/notifications/NotificationClient.h
r172849 r180871 82 82 #endif 83 83 84 virtual bool hasPendingPermissionRequests(ScriptExecutionContext*) const = 0; 85 84 86 // Cancel all outstanding requests for the ScriptExecutionContext 85 87 virtual void cancelRequestsForPermission(ScriptExecutionContext*) = 0; -
trunk/Source/WebKit/mac/ChangeLog
r180848 r180871 1 2015-03-01 Chris Dumez <cdumez@apple.com> 2 3 Make NotificationCenter / Notification suspendable 4 https://bugs.webkit.org/show_bug.cgi?id=142117 5 <rdar://problem/19923085> 6 7 Reviewed by Andreas Kling. 8 9 Provide implementation for NotificationClient::hasPendingPermissionRequests(). 10 The implementation is very simplistic. it will only return false if no 11 request for permission for ever made. This is because there is currently no 12 easy way to figure out if a permission request is pending or not. 13 14 * WebCoreSupport/WebNotificationClient.h: 15 * WebCoreSupport/WebNotificationClient.mm: 16 (WebNotificationClient::requestPermission): 17 (WebNotificationClient::hasPendingPermissionRequests): 18 1 19 2015-02-28 Simon Fraser <simon.fraser@apple.com> 2 20 -
trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h
r162139 r180871 67 67 #endif 68 68 virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*) override { } 69 virtual bool hasPendingPermissionRequests(WebCore::ScriptExecutionContext*) const override; 69 70 virtual WebCore::NotificationClient::Permission checkPermission(WebCore::ScriptExecutionContext*) override; 70 71 … … 79 80 typedef HashMap<RefPtr<WebCore::ScriptExecutionContext>, Vector<RetainPtr<WebNotification>>> NotificationContextMap; 80 81 NotificationContextMap m_notificationContextMap; 82 83 bool m_everRequestedPermission { false }; 81 84 #endif 82 85 }; -
trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm
r161185 r180871 171 171 if (![[m_webView UIDelegate] respondsToSelector:selector]) 172 172 return; 173 173 174 m_everRequestedPermission = true; 175 174 176 WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:context->securityOrigin()]; 175 177 … … 190 192 } 191 193 #endif 194 195 bool WebNotificationClient::hasPendingPermissionRequests(ScriptExecutionContext*) const 196 { 197 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 198 // We know permission was requested but we don't know if the client responded. In this case, we play it 199 // safe and presume there is one pending so that ActiveDOMObjects don't get suspended. 200 return m_everRequestedPermission; 201 #else 202 return false; 203 #endif 204 } 192 205 193 206 #if ENABLE(NOTIFICATIONS) -
trunk/Source/WebKit/win/ChangeLog
r180765 r180871 1 2015-03-01 Chris Dumez <cdumez@apple.com> 2 3 Make NotificationCenter / Notification suspendable 4 https://bugs.webkit.org/show_bug.cgi?id=142117 5 <rdar://problem/19923085> 6 7 Reviewed by Andreas Kling. 8 9 Provide implementation for NotificationClient::hasPendingPermissionRequests(). 10 11 * WebCoreSupport/WebDesktopNotificationsDelegate.cpp: 12 (WebDesktopNotificationsDelegate::requestPermission): 13 (hasPendingPermissionRequests): 14 * WebCoreSupport/WebDesktopNotificationsDelegate.h: 15 1 16 2015-02-26 Brent Fulgham <bfulgham@apple.com> 2 17 -
trunk/Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
r176892 r180871 169 169 } 170 170 171 void WebDesktopNotificationsDelegate::requestPermission(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback)171 void WebDesktopNotificationsDelegate::requestPermission(SecurityOrigin* origin, PassRefPtr<VoidCallback>) 172 172 { 173 173 BString org(origin->toString()); … … 182 182 void WebDesktopNotificationsDelegate::cancelRequestsForPermission(ScriptExecutionContext* context) 183 183 { 184 } 185 186 bool hasPendingPermissionRequests(ScriptExecutionContext*) const 187 { 188 // We can safely return false here because our implementation for requestPermission() never calls 189 // the completion callback. 190 return false; 184 191 } 185 192 -
trunk/Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
r156550 r180871 57 57 virtual void requestPermission(WebCore::SecurityOrigin*, PassRefPtr<WebCore::NotificationPermissionCallback>); 58 58 #endif 59 virtual bool hasPendingPermissionRequests(WebCore::ScriptExecutionContext*) const override; 59 60 virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*); 60 61 virtual WebCore::NotificationClient::Permission checkPermission(const URL&); -
trunk/Source/WebKit2/ChangeLog
r180869 r180871 1 2015-03-01 Chris Dumez <cdumez@apple.com> 2 3 Make NotificationCenter / Notification suspendable 4 https://bugs.webkit.org/show_bug.cgi?id=142117 5 <rdar://problem/19923085> 6 7 Reviewed by Andreas Kling. 8 9 Provide implementation for NotificationClient::hasPendingPermissionRequests(). 10 11 * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: 12 (WebKit::NotificationPermissionRequestManager::hasPendingPermissionRequests): 13 * WebProcess/Notifications/NotificationPermissionRequestManager.h: 14 * WebProcess/WebCoreSupport/WebNotificationClient.cpp: 15 (WebKit::WebNotificationClient::hasPendingPermissionRequests): 16 * WebProcess/WebCoreSupport/WebNotificationClient.h: 17 1 18 2015-03-01 Antti Koivisto <antti@apple.com> 2 19 -
trunk/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
r179409 r180871 121 121 } 122 122 123 bool NotificationPermissionRequestManager::hasPendingPermissionRequests(SecurityOrigin* origin) const 124 { 125 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 126 return m_originToIDMap.contains(origin); 127 #else 128 UNUSED_PARAM(origin); 129 return false; 130 #endif 131 } 132 123 133 NotificationClient::Permission NotificationPermissionRequestManager::permissionLevel(SecurityOrigin* securityOrigin) 124 134 { -
trunk/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h
r149848 r180871 57 57 #endif 58 58 void cancelRequest(WebCore::SecurityOrigin*); 59 bool hasPendingPermissionRequests(WebCore::SecurityOrigin*) const; 59 60 60 61 WebCore::NotificationClient::Permission permissionLevel(WebCore::SecurityOrigin*); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp
r179409 r180871 87 87 #endif 88 88 89 bool WebNotificationClient::hasPendingPermissionRequests(ScriptExecutionContext* context) const 90 { 91 return m_page->notificationPermissionRequestManager()->hasPendingPermissionRequests(context->securityOrigin()); 92 } 93 89 94 void WebNotificationClient::cancelRequestsForPermission(ScriptExecutionContext* context) 90 95 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.h
r162139 r180871 59 59 #endif 60 60 virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*) override; 61 virtual bool hasPendingPermissionRequests(WebCore::ScriptExecutionContext*) const override; 61 62 virtual NotificationClient::Permission checkPermission(WebCore::ScriptExecutionContext*) override; 62 63
Note: See TracChangeset
for help on using the changeset viewer.