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

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

Issue 1454963003: ServiceWorker: Ensure that ServiceWorkerDispatcher always adopts passed handle references (1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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_provider_context.cc
diff --git a/content/child/service_worker/service_worker_provider_context.cc b/content/child/service_worker/service_worker_provider_context.cc
index 9ef323ebcea2b7253b99fe2bccc20b33ce05df93..44e567a65f8b12a8bcd72e4a6122114711747b04 100644
--- a/content/child/service_worker/service_worker_provider_context.cc
+++ b/content/child/service_worker/service_worker_provider_context.cc
@@ -92,7 +92,7 @@ class ServiceWorkerProviderContext::ControllerDelegate
scoped_ptr<ServiceWorkerHandleReference> active) override {
DCHECK(!registration_);
registration_ = registration.Pass();
- installing_ = active.Pass();
+ installing_ = installing.Pass();
falken 2015/11/20 03:35:54 I thought this was in another patch.
nhiroki 2015/11/20 05:14:59 Right. I rebased this patch on that patch. (This p
waiting_ = waiting.Pass();
active_ = active.Pass();
}
@@ -163,18 +163,13 @@ ServiceWorkerProviderContext::~ServiceWorkerProviderContext() {
}
void ServiceWorkerProviderContext::OnAssociateRegistration(
- const ServiceWorkerRegistrationObjectInfo& info,
- const ServiceWorkerVersionAttributes& attrs) {
+ scoped_ptr<ServiceWorkerRegistrationHandleReference> registration,
+ scoped_ptr<ServiceWorkerHandleReference> installing,
+ scoped_ptr<ServiceWorkerHandleReference> waiting,
+ scoped_ptr<ServiceWorkerHandleReference> active) {
DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
- delegate_->AssociateRegistration(
- ServiceWorkerRegistrationHandleReference::Adopt(
- info, thread_safe_sender_.get()),
- ServiceWorkerHandleReference::Adopt(attrs.installing,
- thread_safe_sender_.get()),
- ServiceWorkerHandleReference::Adopt(attrs.waiting,
- thread_safe_sender_.get()),
- ServiceWorkerHandleReference::Adopt(attrs.active,
- thread_safe_sender_.get()));
+ delegate_->AssociateRegistration(registration.Pass(), installing.Pass(),
+ waiting.Pass(), active.Pass());
}
void ServiceWorkerProviderContext::OnDisassociateRegistration() {

Powered by Google App Engine
This is Rietveld 408576698