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 15939b4d64f5c8c6f5b54d20042a83238a85558f..d8273aaef4607725d961b6f3a48340f38e9825d5 100644 |
--- a/content/child/service_worker/service_worker_provider_context.cc |
+++ b/content/child/service_worker/service_worker_provider_context.cc |
@@ -10,7 +10,6 @@ |
#include "content/child/child_thread_impl.h" |
#include "content/child/service_worker/service_worker_dispatcher.h" |
#include "content/child/service_worker/service_worker_handle_reference.h" |
-#include "content/child/service_worker/service_worker_message_sender.h" |
#include "content/child/service_worker/service_worker_registration_handle_reference.h" |
#include "content/child/thread_safe_sender.h" |
#include "content/child/worker_task_runner.h" |
@@ -23,10 +22,10 @@ ServiceWorkerProviderContext::ServiceWorkerProviderContext(int provider_id) |
main_thread_loop_proxy_(base::MessageLoopProxy::current()) { |
if (!ChildThreadImpl::current()) |
return; // May be null in some tests. |
- sender_ = new ServiceWorkerMessageSender( |
- ChildThreadImpl::current()->thread_safe_sender()); |
+ thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); |
ServiceWorkerDispatcher* dispatcher = |
- ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance(sender_.get()); |
+ ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( |
+ thread_safe_sender_.get()); |
DCHECK(dispatcher); |
dispatcher->AddProviderContext(this); |
} |
@@ -70,15 +69,15 @@ void ServiceWorkerProviderContext::SetVersionAttributes( |
if (mask.installing_changed()) { |
installing_ = ServiceWorkerHandleReference::Adopt( |
- attrs.installing, sender_.get()); |
+ attrs.installing, thread_safe_sender_.get()); |
} |
if (mask.waiting_changed()) { |
waiting_ = ServiceWorkerHandleReference::Adopt( |
- attrs.waiting, sender_.get()); |
+ attrs.waiting, thread_safe_sender_.get()); |
} |
if (mask.active_changed()) { |
active_ = ServiceWorkerHandleReference::Adopt( |
- attrs.active, sender_.get()); |
+ attrs.active, thread_safe_sender_.get()); |
} |
} |
@@ -91,12 +90,14 @@ void ServiceWorkerProviderContext::OnAssociateRegistration( |
DCHECK_NE(kInvalidServiceWorkerRegistrationId, info.registration_id); |
DCHECK_NE(kInvalidServiceWorkerRegistrationHandleId, info.handle_id); |
- registration_ = |
- ServiceWorkerRegistrationHandleReference::Adopt(info, sender_.get()); |
- installing_ = |
- ServiceWorkerHandleReference::Adopt(attrs.installing, sender_.get()); |
- waiting_ = ServiceWorkerHandleReference::Adopt(attrs.waiting, sender_.get()); |
- active_ = ServiceWorkerHandleReference::Adopt(attrs.active, sender_.get()); |
+ registration_ = ServiceWorkerRegistrationHandleReference::Adopt( |
+ info, thread_safe_sender_.get()); |
+ installing_ = ServiceWorkerHandleReference::Adopt( |
+ attrs.installing, thread_safe_sender_.get()); |
+ waiting_ = ServiceWorkerHandleReference::Adopt( |
+ attrs.waiting, thread_safe_sender_.get()); |
+ active_ = ServiceWorkerHandleReference::Adopt( |
+ attrs.active, thread_safe_sender_.get()); |
} |
void ServiceWorkerProviderContext::OnDisassociateRegistration() { |
@@ -143,7 +144,8 @@ void ServiceWorkerProviderContext::OnSetControllerServiceWorker( |
// This context is is the primary owner of this handle, keeps the |
// initial reference until it goes away. |
- controller_ = ServiceWorkerHandleReference::Adopt(info, sender_.get()); |
+ controller_ = |
+ ServiceWorkerHandleReference::Adopt(info, thread_safe_sender_.get()); |
// TODO(kinuko): We can forward the message to other threads here |
// when we support navigator.serviceWorker in dedicated workers. |