Index: content/child/notifications/notification_manager.cc |
diff --git a/content/child/notifications/notification_manager.cc b/content/child/notifications/notification_manager.cc |
index e39588e44abff3db1235b61266ddc6f946fb0a86..18a7363d7b421046a4587df821eade16954f006c 100644 |
--- a/content/child/notifications/notification_manager.cc |
+++ b/content/child/notifications/notification_manager.cc |
@@ -17,7 +17,7 @@ |
#include "content/child/thread_safe_sender.h" |
#include "content/child/worker_task_runner.h" |
#include "content/public/common/platform_notification_data.h" |
-#include "third_party/WebKit/public/platform/WebSerializedOrigin.h" |
+#include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationDelegate.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
@@ -68,7 +68,7 @@ void NotificationManager::OnWorkerRunLoopStopped() { |
} |
void NotificationManager::show( |
- const blink::WebSerializedOrigin& origin, |
+ const blink::WebSecurityOrigin& origin, |
const blink::WebNotificationData& notification_data, |
blink::WebNotificationDelegate* delegate) { |
if (notification_data.icon.isEmpty()) { |
@@ -87,7 +87,7 @@ void NotificationManager::show( |
} |
void NotificationManager::showPersistent( |
- const blink::WebSerializedOrigin& origin, |
+ const blink::WebSecurityOrigin& origin, |
const blink::WebNotificationData& notification_data, |
blink::WebServiceWorkerRegistration* service_worker_registration, |
blink::WebNotificationShowCallbacks* callbacks) { |
@@ -184,11 +184,13 @@ void NotificationManager::close(blink::WebNotificationDelegate* delegate) { |
} |
void NotificationManager::closePersistent( |
- const blink::WebSerializedOrigin& origin, |
+ const blink::WebSecurityOrigin& origin, |
int64_t persistent_notification_id) { |
thread_safe_sender_->Send(new PlatformNotificationHostMsg_ClosePersistent( |
- GURL(origin.string()), |
- persistent_notification_id)); |
+ // TODO(mkwst): This is potentially doing the wrong thing with unique |
Peter Beverloo
2015/07/10 14:19:17
nit: We usually have these TODOs outside statement
|
+ // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See |
+ // https://crbug.com/490074 for detail. |
Peter Beverloo
2015/07/10 14:19:17
There's a notifications browser test to verify tha
|
+ GURL(origin.toString()), persistent_notification_id)); |
} |
void NotificationManager::notifyDelegateDestroyed( |
@@ -206,11 +208,14 @@ void NotificationManager::notifyDelegateDestroyed( |
} |
WebNotificationPermission NotificationManager::checkPermission( |
- const blink::WebSerializedOrigin& origin) { |
+ const blink::WebSecurityOrigin& origin) { |
WebNotificationPermission permission = |
blink::WebNotificationPermissionAllowed; |
+ // TODO(mkwst): This is potentially doing the wrong thing with unique |
+ // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See |
+ // https://crbug.com/490074 for detail. |
thread_safe_sender_->Send(new PlatformNotificationHostMsg_CheckPermission( |
- GURL(origin.string()), &permission)); |
+ GURL(origin.toString()), &permission)); |
return permission; |
} |
@@ -300,7 +305,7 @@ void NotificationManager::OnDidGetNotifications( |
} |
void NotificationManager::DisplayPageNotification( |
- const blink::WebSerializedOrigin& origin, |
+ const blink::WebSecurityOrigin& origin, |
const blink::WebNotificationData& notification_data, |
blink::WebNotificationDelegate* delegate, |
const SkBitmap& icon) { |
@@ -308,16 +313,16 @@ void NotificationManager::DisplayPageNotification( |
notification_dispatcher_->GenerateNotificationId(CurrentWorkerId()); |
active_page_notifications_[notification_id] = delegate; |
- thread_safe_sender_->Send( |
- new PlatformNotificationHostMsg_Show( |
- notification_id, |
- GURL(origin.string()), |
- icon, |
- ToPlatformNotificationData(notification_data))); |
+ // TODO(mkwst): This is potentially doing the wrong thing with unique |
+ // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See |
+ // https://crbug.com/490074 for detail. |
+ thread_safe_sender_->Send(new PlatformNotificationHostMsg_Show( |
+ notification_id, GURL(origin.toString()), icon, |
+ ToPlatformNotificationData(notification_data))); |
} |
void NotificationManager::DisplayPersistentNotification( |
- const blink::WebSerializedOrigin& origin, |
+ const blink::WebSecurityOrigin& origin, |
const blink::WebNotificationData& notification_data, |
int64_t service_worker_registration_id, |
scoped_ptr<blink::WebNotificationShowCallbacks> callbacks, |
@@ -330,13 +335,12 @@ void NotificationManager::DisplayPersistentNotification( |
pending_show_notification_requests_.AddWithID(callbacks.release(), |
request_id); |
- thread_safe_sender_->Send( |
- new PlatformNotificationHostMsg_ShowPersistent( |
- request_id, |
- service_worker_registration_id, |
- GURL(origin.string()), |
- icon, |
- ToPlatformNotificationData(notification_data))); |
+ // TODO(mkwst): This is potentially doing the wrong thing with unique |
+ // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See |
+ // https://crbug.com/490074 for detail. |
+ thread_safe_sender_->Send(new PlatformNotificationHostMsg_ShowPersistent( |
+ request_id, service_worker_registration_id, GURL(origin.toString()), icon, |
+ ToPlatformNotificationData(notification_data))); |
} |
} // namespace content |