Index: Source/modules/notifications/Notification.cpp |
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp |
index 78935834f83fb4ba6c14892e13da8eff0ae150c5..8bbeb9d320d82b3b4386bf8048b228af2bcb4012 100644 |
--- a/Source/modules/notifications/Notification.cpp |
+++ b/Source/modules/notifications/Notification.cpp |
@@ -39,6 +39,7 @@ |
#include "core/page/WindowFocusAllowedIndicator.h" |
#include "modules/notifications/NotificationClient.h" |
#include "modules/notifications/NotificationController.h" |
+#include "modules/notifications/NotificationPermissionClient.h" |
namespace blink { |
@@ -168,8 +169,15 @@ const String& Notification::permission(ExecutionContext* context) |
void Notification::requestPermission(ExecutionContext* context, PassOwnPtr<NotificationPermissionCallback> callback) |
{ |
- ASSERT(toDocument(context)->page()); |
- NotificationController::clientFrom(context).requestPermission(context, callback); |
+ NotificationPermissionClient* permissionClient = NotificationPermissionClient::from(context); |
+ if (permissionClient) { |
abarth-chromium
2014/07/29 16:52:29
You can merge these two lines.
Peter Beverloo
2014/07/30 11:22:55
Done.
|
+ permissionClient->requestPermission(context, callback); |
+ return; |
+ } |
+ |
+ // FIXME: What is the intended behavior for Notification.requestPermission when called |
+ // from a Worker context? Should it be a no-op, or should |callback| be invoked with |
+ // the current permission level? |
Peter Beverloo
2014/07/28 17:03:16
note: I've sent an e-mail to the WHATWG list to cl
|
} |
bool Notification::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) |