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

Unified Diff: content/browser/service_worker/service_worker_context_wrapper.cc

Issue 2181553003: Stop passing const-reference of SWRegistration in all GetRegistrationsCallbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ServiceWorkerContextCore::DidFindRegistrationForCheckHasServiceWorker() Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_context_wrapper.cc
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 0c32d7168594bb9f4070c13c35cdde1da532f790..bb5d2dedf23143e92054e6d3e1dc720bac54169c 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -55,7 +55,7 @@ void WorkerStarted(const ServiceWorkerContextWrapper::StatusCallback& callback,
void StartActiveWorkerOnIO(
const ServiceWorkerContextWrapper::StatusCallback& callback,
ServiceWorkerStatusCode status,
- const scoped_refptr<ServiceWorkerRegistration>& registration) {
+ scoped_refptr<ServiceWorkerRegistration> registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (status == SERVICE_WORKER_OK) {
// Pass the reference of |registration| to WorkerStarted callback to prevent
@@ -72,7 +72,7 @@ void StartActiveWorkerOnIO(
void SkipWaitingWorkerOnIO(
ServiceWorkerStatusCode status,
- const scoped_refptr<ServiceWorkerRegistration>& registration) {
+ scoped_refptr<ServiceWorkerRegistration> registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (status != SERVICE_WORKER_OK || !registration->waiting_version())
return;
@@ -400,7 +400,7 @@ void ServiceWorkerContextWrapper::StopAllServiceWorkersForOrigin(
void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate(
ServiceWorkerStatusCode status,
- const scoped_refptr<ServiceWorkerRegistration>& registration) {
+ scoped_refptr<ServiceWorkerRegistration> registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (status != SERVICE_WORKER_OK)
@@ -564,7 +564,7 @@ void ServiceWorkerContextWrapper::FindReadyRegistrationForId(
void ServiceWorkerContextWrapper::DidFindRegistrationForFindReady(
const FindRegistrationCallback& callback,
ServiceWorkerStatusCode status,
- const scoped_refptr<ServiceWorkerRegistration>& registration) {
+ scoped_refptr<ServiceWorkerRegistration> registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (status != SERVICE_WORKER_OK) {
callback.Run(status, nullptr);
@@ -587,17 +587,17 @@ void ServiceWorkerContextWrapper::DidFindRegistrationForFindReady(
// Wait until the version is activated.
active_version->RegisterStatusChangeCallback(base::Bind(
&ServiceWorkerContextWrapper::OnStatusChangedForFindReadyRegistration,
- this, callback, registration));
+ this, callback, std::move(registration)));
return;
}
DCHECK_EQ(ServiceWorkerVersion::ACTIVATED, active_version->status());
- callback.Run(SERVICE_WORKER_OK, registration);
+ callback.Run(SERVICE_WORKER_OK, std::move(registration));
}
void ServiceWorkerContextWrapper::OnStatusChangedForFindReadyRegistration(
const FindRegistrationCallback& callback,
- const scoped_refptr<ServiceWorkerRegistration>& registration) {
+ scoped_refptr<ServiceWorkerRegistration> registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
scoped_refptr<ServiceWorkerVersion> active_version =
registration->active_version();

Powered by Google App Engine
This is Rietveld 408576698