| Index: content/browser/service_worker/service_worker_provider_host.cc
|
| diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc
|
| index 218fd94064de4ba2a364375a3a6cbc2f8270392a..79ef120f5a11cee9e68f9b3418f6c4b5ab24f5f7 100644
|
| --- a/content/browser/service_worker/service_worker_provider_host.cc
|
| +++ b/content/browser/service_worker/service_worker_provider_host.cc
|
| @@ -6,6 +6,8 @@
|
|
|
| #include "base/stl_util.h"
|
| #include "content/browser/service_worker/service_worker_context_core.h"
|
| +#include "content/browser/service_worker/service_worker_dispatcher_host.h"
|
| +#include "content/browser/service_worker/service_worker_handle.h"
|
| #include "content/browser/service_worker/service_worker_utils.h"
|
| #include "content/browser/service_worker/service_worker_version.h"
|
|
|
| @@ -13,10 +15,12 @@ namespace content {
|
|
|
| ServiceWorkerProviderHost::ServiceWorkerProviderHost(
|
| int process_id, int provider_id,
|
| - base::WeakPtr<ServiceWorkerContextCore> context)
|
| + base::WeakPtr<ServiceWorkerContextCore> context,
|
| + ServiceWorkerDispatcherHost* dispatcher_host)
|
| : process_id_(process_id),
|
| provider_id_(provider_id),
|
| - context_(context) {
|
| + context_(context),
|
| + dispatcher_host_(dispatcher_host) {
|
| }
|
|
|
| ServiceWorkerProviderHost::~ServiceWorkerProviderHost() {
|
| @@ -42,13 +46,21 @@ void ServiceWorkerProviderHost::SetActiveVersion(
|
| version->AddControllee(this);
|
| if (previous_version)
|
| previous_version->RemoveControllee(this);
|
| +
|
| + dispatcher_host_->RegisterServiceWorkerHandle(
|
| + ServiceWorkerHandle::Create(context_, dispatcher_host_, version));
|
| // TODO(kinuko): dispatch activechange event to the script clients.
|
| + // dispatcher_host_->Send(ServiceWorkerMsg_ActiveChangeEvent(...));
|
| }
|
|
|
| void ServiceWorkerProviderHost::SetPendingVersion(
|
| ServiceWorkerVersion* version) {
|
| pending_version_ = version;
|
| +
|
| + dispatcher_host_->RegisterServiceWorkerHandle(
|
| + ServiceWorkerHandle::Create(context_, dispatcher_host_, version));
|
| // TODO(kinuko): dispatch pendingchange event to the script clients.
|
| + // dispatcher_host_->Send(ServiceWorkerMsg_PendingChangeEvent(...));
|
| }
|
|
|
| bool ServiceWorkerProviderHost::SetHostedVersionId(int64 version_id) {
|
|
|