Changeset 135007 in webkit
- Timestamp:
- Nov 16, 2012, 3:02:52 PM (13 years ago)
- Location:
- branches/safari-536.28-branch
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-536.28-branch/Source/WebCore/ChangeLog
r135005 r135007 1 2012-11-16 Lucas Forschler <lforschler@apple.com> 2 3 Merge r131280 4 5 2012-10-14 Jon Lee <jonlee@apple.com> 6 7 Allow notification origin permission request when no js callback is provided 8 https://bugs.webkit.org/show_bug.cgi?id=63615 9 <rdar://problem/11059590> 10 11 Reviewed by Sam Weinig. 12 13 Instead of throwing a type error when no callback is provided, we pass a null callback. 14 15 Test: http/tests/notifications/legacy/request-no-callback.html 16 17 * bindings/js/JSDesktopNotificationsCustom.cpp: 18 (WebCore::JSNotificationCenter::requestPermission): 19 1 20 2012-11-16 Lucas Forschler <lforschler@apple.com> 2 21 -
branches/safari-536.28-branch/Source/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
r115943 r135007 59 59 return throwSyntaxError(exec); 60 60 61 if (!exec->argument(0).isObject()) 62 return throwTypeError(exec); 63 64 PassRefPtr<JSCustomVoidCallback> callback = JSCustomVoidCallback::create(exec->argument(0).getObject(), toJSDOMGlobalObject(static_cast<Document*>(context), exec)); 65 66 impl()->requestPermission(callback); 61 // If a callback function is provided as first argument, convert to a VoidCallback. 62 RefPtr<JSVoidCallback> callback; 63 if (exec->argument(0).isObject()) { 64 callback = JSVoidCallback::create(exec->argument(0).getObject(), toJSDOMGlobalObject(static_cast<Document*>(context), exec)); 65 if (exec->hadException()) 66 return jsUndefined(); 67 } 68 impl()->requestPermission(callback.release()); 67 69 return jsUndefined(); 68 70 } -
branches/safari-536.28-branch/Source/WebKit/mac/ChangeLog
r135005 r135007 1 2012-11-16 Lucas Forschler <lforschler@apple.com> 2 3 Merge r131280 4 5 2012-10-14 Jon Lee <jonlee@apple.com> 6 7 Allow notification origin permission request when no js callback is provided 8 https://bugs.webkit.org/show_bug.cgi?id=63615 9 <rdar://problem/11059590> 10 11 Reviewed by Sam Weinig. 12 13 Introduce a boolean to determine whether the request was using the legacy or standard API. This way, 14 we do not fall through to calling the standard API's callback if the legacy API's callback is null. 15 16 * WebCoreSupport/WebNotificationClient.mm: 17 (WebCore): 18 (-[WebNotificationPolicyListener initWithVoidCallback:]): 19 (-[WebNotificationPolicyListener allow]): 20 (-[WebNotificationPolicyListener deny]): 21 1 22 2012-11-16 Lucas Forschler <lforschler@apple.com> 2 23 -
branches/safari-536.28-branch/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm
r115943 r135007 55 55 #if ENABLE(LEGACY_NOTIFICATIONS) 56 56 RefPtr<VoidCallback> _voidCallback; 57 bool _isLegacyRequest; 57 58 #endif 58 59 } … … 251 252 return nil; 252 253 253 ASSERT(callback);254 _isLegacyRequest = true; 254 255 _voidCallback = callback; 255 256 return self; … … 260 261 { 261 262 #if ENABLE(LEGACY_NOTIFICATIONS) 262 if (_voidCallback) { 263 _voidCallback->handleEvent(); 263 if (_isLegacyRequest) { 264 if (_voidCallback) 265 _voidCallback->handleEvent(); 264 266 return; 265 267 } … … 273 275 { 274 276 #if ENABLE(LEGACY_NOTIFICATIONS) 275 if (_voidCallback) { 276 _voidCallback->handleEvent(); 277 if (_isLegacyRequest) { 278 if (_voidCallback) 279 _voidCallback->handleEvent(); 277 280 return; 278 281 } -
branches/safari-536.28-branch/Source/WebKit2/ChangeLog
r135005 r135007 1 2012-11-16 Lucas Forschler <lforschler@apple.com> 2 3 Merge r131280 4 5 2012-10-14 Jon Lee <jonlee@apple.com> 6 7 Allow notification origin permission request when no js callback is provided 8 https://bugs.webkit.org/show_bug.cgi?id=63615 9 <rdar://problem/11059590> 10 11 Reviewed by Sam Weinig. 12 13 Null checks already exist for both standard and legacy API callbacks, so no changes are needed here 14 like there are in WebKit 1. The checks existed because the callbacks are held in a hash map used to keep 15 track of pending requests. 16 17 Also, add a check for a null callback when short circuiting. 18 19 * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: 20 (WebKit::NotificationPermissionRequestManager::startRequest): 21 1 22 2012-11-16 Lucas Forschler <lforschler@apple.com> 2 23 -
branches/safari-536.28-branch/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
r134263 r135007 82 82 NotificationClient::Permission permission = permissionLevel(origin); 83 83 if (permission != NotificationClient::PermissionNotAllowed) { 84 callback->handleEvent(); 84 if (callback) 85 callback->handleEvent(); 85 86 return; 86 87 } -
branches/safari-536.28-branch/Tools/ChangeLog
r134991 r135007 1 2012-11-16 Lucas Forschler <lforschler@apple.com> 2 3 Merge r131280 4 5 2012-10-14 Jon Lee <jonlee@apple.com> 6 7 Allow notification origin permission request when no js callback is provided 8 https://bugs.webkit.org/show_bug.cgi?id=63615 9 <rdar://problem/11059590> 10 11 Reviewed by Sam Weinig. 12 13 Teach DRT to look at the existing entries in the permission hash map when permission is requested. 14 15 * DumpRenderTree/mac/MockWebNotificationProvider.h: Expose policyForOrigin. 16 * DumpRenderTree/mac/MockWebNotificationProvider.mm: 17 (-[MockWebNotificationProvider setWebNotificationOrigin:permission:]): 18 * DumpRenderTree/mac/UIDelegate.mm: 19 (-[UIDelegate webView:decidePolicyForNotificationRequestFromOrigin:listener:]): Look at whether a 20 policy for the origin already exists. If so, accept or deny the request as appropriate. Otherwise, 21 accept by default. 22 1 23 2012-11-16 Lucas Forschler <lforschler@apple.com> 2 24
Note:
See TracChangeset
for help on using the changeset viewer.