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

Unified Diff: content/browser/service_worker/service_worker_register_job.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_register_job.cc
diff --git a/content/browser/service_worker/service_worker_register_job.cc b/content/browser/service_worker/service_worker_register_job.cc
index fbfb635c3ba80d4e9cca356aca8b661f04c343b5..b6125adcb1a3cd6c9b1b53c56484531aff98081a 100644
--- a/content/browser/service_worker/service_worker_register_job.cc
+++ b/content/browser/service_worker/service_worker_register_job.cc
@@ -152,10 +152,10 @@ ServiceWorkerRegisterJob::Internal::Internal() {}
ServiceWorkerRegisterJob::Internal::~Internal() {}
void ServiceWorkerRegisterJob::set_registration(
- const scoped_refptr<ServiceWorkerRegistration>& registration) {
+ scoped_refptr<ServiceWorkerRegistration> registration) {
DCHECK(phase_ == START || phase_ == REGISTER) << phase_;
DCHECK(!internal_.registration.get());
- internal_.registration = registration;
+ internal_.registration = std::move(registration);
}
ServiceWorkerRegistration* ServiceWorkerRegisterJob::registration() {
@@ -209,7 +209,7 @@ void ServiceWorkerRegisterJob::SetPhase(Phase phase) {
// Throughout this file, comments in quotes are excerpts from the spec.
void ServiceWorkerRegisterJob::ContinueWithRegistration(
ServiceWorkerStatusCode status,
- const scoped_refptr<ServiceWorkerRegistration>& existing_registration) {
+ scoped_refptr<ServiceWorkerRegistration> existing_registration) {
DCHECK_EQ(REGISTRATION_JOB, job_type_);
if (status != SERVICE_WORKER_ERROR_NOT_FOUND && status != SERVICE_WORKER_OK) {
Complete(status);
@@ -248,7 +248,7 @@ void ServiceWorkerRegisterJob::ContinueWithRegistration(
void ServiceWorkerRegisterJob::ContinueWithUpdate(
ServiceWorkerStatusCode status,
- const scoped_refptr<ServiceWorkerRegistration>& existing_registration) {
+ scoped_refptr<ServiceWorkerRegistration> existing_registration) {
DCHECK_EQ(UPDATE_JOB, job_type_);
if (status != SERVICE_WORKER_OK) {
Complete(status);
@@ -294,7 +294,7 @@ void ServiceWorkerRegisterJob::RegisterAndContinue() {
}
void ServiceWorkerRegisterJob::ContinueWithUninstallingRegistration(
- const scoped_refptr<ServiceWorkerRegistration>& existing_registration,
+ scoped_refptr<ServiceWorkerRegistration> existing_registration,
ServiceWorkerStatusCode status) {
if (status != SERVICE_WORKER_OK) {
Complete(status);
@@ -306,7 +306,7 @@ void ServiceWorkerRegisterJob::ContinueWithUninstallingRegistration(
}
void ServiceWorkerRegisterJob::ContinueWithRegistrationForSameScriptUrl(
- const scoped_refptr<ServiceWorkerRegistration>& existing_registration,
+ scoped_refptr<ServiceWorkerRegistration> existing_registration,
ServiceWorkerStatusCode status) {
if (status != SERVICE_WORKER_OK) {
Complete(status);
« no previous file with comments | « content/browser/service_worker/service_worker_register_job.h ('k') | content/browser/service_worker/service_worker_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698