| Index: content/shell/browser/layout_test/layout_test_push_messaging_service.cc
|
| diff --git a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc
|
| index e6639c3bd68c41edd1a33adc884ac553f892a306..b8240e5acb0a9b2368d044d84f387c3ad198db86 100644
|
| --- a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc
|
| +++ b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc
|
| @@ -22,6 +22,7 @@ void LayoutTestPushMessagingService::SetPermission(const GURL& origin,
|
|
|
| void LayoutTestPushMessagingService::ClearPermissions() {
|
| permission_map_.clear();
|
| + registrations_.clear();
|
| }
|
|
|
| GURL LayoutTestPushMessagingService::GetPushEndpoint() {
|
| @@ -47,6 +48,7 @@ void LayoutTestPushMessagingService::RegisterFromWorker(
|
| const PushMessagingService::RegisterCallback& callback) {
|
| if (GetPermissionStatus(requesting_origin, requesting_origin) ==
|
| blink::WebPushPermissionStatusGranted) {
|
| + registrations_.insert(requesting_origin);
|
| callback.Run("layoutTestRegistrationId",
|
| PUSH_REGISTRATION_STATUS_SUCCESS_FROM_PUSH_SERVICE);
|
| } else {
|
| @@ -72,4 +74,11 @@ LayoutTestPushMessagingService::GetPermissionStatus(
|
| return it->second;
|
| }
|
|
|
| +void LayoutTestPushMessagingService::Unregister(
|
| + const GURL& requesting_origin,
|
| + int64 service_worker_registration_id,
|
| + const UnregisterCallback& callback) {
|
| + callback.Run(registrations_.erase(requesting_origin) == 1);
|
| +}
|
| +
|
| } // namespace content
|
|
|