| 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 8ec2e71bd573d8ee389ebb916b363d510df4abbf..d7763f67ff545b8e967e1f91881ccb94c2ffc81e 100644
|
| --- a/content/child/service_worker/service_worker_provider_context.cc
|
| +++ b/content/child/service_worker/service_worker_provider_context.cc
|
| @@ -36,6 +36,11 @@ ServiceWorkerProviderContext::~ServiceWorkerProviderContext() {
|
| }
|
| }
|
|
|
| +ServiceWorkerHandleReference* ServiceWorkerProviderContext::installing() {
|
| + DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
|
| + return installing_.get();
|
| +}
|
| +
|
| ServiceWorkerHandleReference* ServiceWorkerProviderContext::waiting() {
|
| DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
|
| return waiting_.get();
|
| @@ -54,6 +59,8 @@ void ServiceWorkerProviderContext::OnServiceWorkerStateChanged(
|
| which = controller_.get();
|
| } else if (handle_id == waiting_handle_id()) {
|
| which = waiting_.get();
|
| + } else if (handle_id == installing_handle_id()) {
|
| + which = installing_.get();
|
| }
|
|
|
| // We should only get messages for ServiceWorkers associated with
|
| @@ -66,6 +73,13 @@ void ServiceWorkerProviderContext::OnServiceWorkerStateChanged(
|
| // when we support navigator.serviceWorker in dedicated workers.
|
| }
|
|
|
| +void ServiceWorkerProviderContext::OnSetInstallingServiceWorker(
|
| + int provider_id,
|
| + const ServiceWorkerObjectInfo& info) {
|
| + DCHECK_EQ(provider_id_, provider_id);
|
| + installing_ = ServiceWorkerHandleReference::Adopt(info, thread_safe_sender_);
|
| +}
|
| +
|
| void ServiceWorkerProviderContext::OnSetWaitingServiceWorker(
|
| int provider_id,
|
| const ServiceWorkerObjectInfo& info) {
|
| @@ -86,15 +100,22 @@ void ServiceWorkerProviderContext::OnSetControllerServiceWorker(
|
| // when we support navigator.serviceWorker in dedicated workers.
|
| }
|
|
|
| -int ServiceWorkerProviderContext::controller_handle_id() const {
|
| +int ServiceWorkerProviderContext::installing_handle_id() const {
|
| DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
|
| - return controller_ ? controller_->info().handle_id
|
| + return installing_ ? installing_->info().handle_id
|
| : kInvalidServiceWorkerHandleId;
|
| }
|
|
|
| int ServiceWorkerProviderContext::waiting_handle_id() const {
|
| DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
|
| - return waiting_ ? waiting_->info().handle_id : kInvalidServiceWorkerHandleId;
|
| + return waiting_ ? waiting_->info().handle_id
|
| + : kInvalidServiceWorkerHandleId;
|
| +}
|
| +
|
| +int ServiceWorkerProviderContext::controller_handle_id() const {
|
| + DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
|
| + return controller_ ? controller_->info().handle_id
|
| + : kInvalidServiceWorkerHandleId;
|
| }
|
|
|
| } // namespace content
|
|
|