Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: content/browser/push_messaging/push_messaging_router.cc

Issue 2183783002: Revert of Stop passing const-reference of SWRegistration in all GetRegistrationsCallbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/push_messaging/push_messaging_router.h" 5 #include "content/browser/push_messaging/push_messaging_router.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" 10 #include "content/browser/service_worker/service_worker_context_wrapper.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 service_worker_registration_id, origin, 66 service_worker_registration_id, origin,
67 base::Bind(&PushMessagingRouter::FindServiceWorkerRegistrationCallback, 67 base::Bind(&PushMessagingRouter::FindServiceWorkerRegistrationCallback,
68 payload, deliver_message_callback)); 68 payload, deliver_message_callback));
69 } 69 }
70 70
71 // static 71 // static
72 void PushMessagingRouter::FindServiceWorkerRegistrationCallback( 72 void PushMessagingRouter::FindServiceWorkerRegistrationCallback(
73 const PushEventPayload& payload, 73 const PushEventPayload& payload,
74 const DeliverMessageCallback& deliver_message_callback, 74 const DeliverMessageCallback& deliver_message_callback,
75 ServiceWorkerStatusCode service_worker_status, 75 ServiceWorkerStatusCode service_worker_status,
76 scoped_refptr<ServiceWorkerRegistration> service_worker_registration) { 76 const scoped_refptr<ServiceWorkerRegistration>&
77 service_worker_registration) {
77 DCHECK_CURRENTLY_ON(BrowserThread::IO); 78 DCHECK_CURRENTLY_ON(BrowserThread::IO);
78 // TODO(mvanouwerkerk): UMA logging. 79 // TODO(mvanouwerkerk): UMA logging.
79 if (service_worker_status != SERVICE_WORKER_OK) { 80 if (service_worker_status != SERVICE_WORKER_OK) {
80 RunDeliverCallback(deliver_message_callback, 81 RunDeliverCallback(deliver_message_callback,
81 PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER); 82 PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER);
82 return; 83 return;
83 } 84 }
84 85
85 ServiceWorkerVersion* version = service_worker_registration->active_version(); 86 ServiceWorkerVersion* version = service_worker_registration->active_version();
86 DCHECK(version); 87 DCHECK(version);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 case SERVICE_WORKER_ERROR_MAX_VALUE: 152 case SERVICE_WORKER_ERROR_MAX_VALUE:
152 NOTREACHED() << "Got unexpected error code: " << service_worker_status 153 NOTREACHED() << "Got unexpected error code: " << service_worker_status
153 << " " << ServiceWorkerStatusToString(service_worker_status); 154 << " " << ServiceWorkerStatusToString(service_worker_status);
154 delivery_status = PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR; 155 delivery_status = PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR;
155 break; 156 break;
156 } 157 }
157 RunDeliverCallback(deliver_message_callback, delivery_status); 158 RunDeliverCallback(deliver_message_callback, delivery_status);
158 } 159 }
159 160
160 } // namespace content 161 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/push_messaging/push_messaging_router.h ('k') | content/browser/service_worker/foreign_fetch_request_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698