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

Unified Diff: content/child/service_worker/service_worker_dispatcher.cc

Issue 1544293002: Convert Pass()→std::move() in //content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/child/service_worker/service_worker_dispatcher.cc
diff --git a/content/child/service_worker/service_worker_dispatcher.cc b/content/child/service_worker/service_worker_dispatcher.cc
index a71d69c1bf454a4f14e3abc881ab3302a87ce28d..b8fd142164af94ba8fe05d587602770744d27432 100644
--- a/content/child/service_worker/service_worker_dispatcher.cc
+++ b/content/child/service_worker/service_worker_dispatcher.cc
@@ -5,6 +5,7 @@
#include "content/child/service_worker/service_worker_dispatcher.h"
#include <stddef.h>
+#include <utility>
#include "base/lazy_instance.h"
#include "base/single_thread_task_runner.h"
@@ -275,7 +276,8 @@ ServiceWorkerDispatcher::GetOrCreateServiceWorker(
return found->second;
// WebServiceWorkerImpl constructor calls AddServiceWorker.
- return new WebServiceWorkerImpl(handle_ref.Pass(), thread_safe_sender_.get());
+ return new WebServiceWorkerImpl(std::move(handle_ref),
+ thread_safe_sender_.get());
}
scoped_refptr<WebServiceWorkerRegistrationImpl>
@@ -323,10 +325,11 @@ ServiceWorkerDispatcher::GetOrAdoptRegistration(
// WebServiceWorkerRegistrationImpl constructor calls
// AddServiceWorkerRegistration.
scoped_refptr<WebServiceWorkerRegistrationImpl> registration(
- new WebServiceWorkerRegistrationImpl(registration_ref.Pass()));
- registration->SetInstalling(GetOrCreateServiceWorker(installing_ref.Pass()));
- registration->SetWaiting(GetOrCreateServiceWorker(waiting_ref.Pass()));
- registration->SetActive(GetOrCreateServiceWorker(active_ref.Pass()));
+ new WebServiceWorkerRegistrationImpl(std::move(registration_ref)));
+ registration->SetInstalling(
+ GetOrCreateServiceWorker(std::move(installing_ref)));
+ registration->SetWaiting(GetOrCreateServiceWorker(std::move(waiting_ref)));
+ registration->SetActive(GetOrCreateServiceWorker(std::move(active_ref)));
return registration;
}
@@ -345,7 +348,8 @@ void ServiceWorkerDispatcher::OnAssociateRegistration(
ProviderContextMap::iterator context = provider_contexts_.find(provider_id);
if (context != provider_contexts_.end()) {
context->second->OnAssociateRegistration(
- registration.Pass(), installing.Pass(), waiting.Pass(), active.Pass());
+ std::move(registration), std::move(installing), std::move(waiting),
+ std::move(active));
}
}
@@ -657,11 +661,12 @@ void ServiceWorkerDispatcher::OnSetVersionAttributes(
// Populate the version fields (eg. .installing) with worker objects.
ChangedVersionAttributesMask mask(changed_mask);
if (mask.installing_changed())
- found->second->SetInstalling(GetOrCreateServiceWorker(installing.Pass()));
+ found->second->SetInstalling(
+ GetOrCreateServiceWorker(std::move(installing)));
if (mask.waiting_changed())
- found->second->SetWaiting(GetOrCreateServiceWorker(waiting.Pass()));
+ found->second->SetWaiting(GetOrCreateServiceWorker(std::move(waiting)));
if (mask.active_changed())
- found->second->SetActive(GetOrCreateServiceWorker(active.Pass()));
+ found->second->SetActive(GetOrCreateServiceWorker(std::move(active)));
}
}
@@ -691,7 +696,7 @@ void ServiceWorkerDispatcher::OnSetControllerServiceWorker(
scoped_ptr<ServiceWorkerHandleReference> handle_ref = Adopt(info);
ProviderContextMap::iterator provider = provider_contexts_.find(provider_id);
if (provider != provider_contexts_.end())
- provider->second->OnSetControllerServiceWorker(handle_ref.Pass());
+ provider->second->OnSetControllerServiceWorker(std::move(handle_ref));
ProviderClientMap::iterator found = provider_clients_.find(provider_id);
if (found != provider_clients_.end()) {
« no previous file with comments | « content/child/scoped_web_callbacks.h ('k') | content/child/service_worker/service_worker_network_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698