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

Side by Side Diff: content/child/service_worker/web_service_worker_provider_impl.cc

Issue 354643003: ServiceWorker: Support navigator.serviceWorker.active (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/service_worker/web_service_worker_provider_impl.h" 5 #include "content/child/service_worker/web_service_worker_provider_impl.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/child/child_thread.h" 9 #include "content/child/child_thread.h"
10 #include "content/child/service_worker/service_worker_dispatcher.h" 10 #include "content/child/service_worker/service_worker_dispatcher.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 if (context_->installing_handle_id() != kInvalidServiceWorkerHandleId) { 50 if (context_->installing_handle_id() != kInvalidServiceWorkerHandleId) {
51 client->setInstalling(GetDispatcher()->GetServiceWorker( 51 client->setInstalling(GetDispatcher()->GetServiceWorker(
52 context_->installing()->info(), false)); 52 context_->installing()->info(), false));
53 } 53 }
54 54
55 if (context_->waiting_handle_id() != kInvalidServiceWorkerHandleId) { 55 if (context_->waiting_handle_id() != kInvalidServiceWorkerHandleId) {
56 client->setWaiting(GetDispatcher()->GetServiceWorker( 56 client->setWaiting(GetDispatcher()->GetServiceWorker(
57 context_->waiting()->info(), false)); 57 context_->waiting()->info(), false));
58 } 58 }
59 59
60 if (context_->active_handle_id() != kInvalidServiceWorkerHandleId) {
61 client->setActive(GetDispatcher()->GetServiceWorker(
62 context_->active()->info(), false));
63 }
64
60 if (context_->controller_handle_id() != kInvalidServiceWorkerHandleId) { 65 if (context_->controller_handle_id() != kInvalidServiceWorkerHandleId) {
61 client->setController(GetDispatcher()->GetServiceWorker( 66 client->setController(GetDispatcher()->GetServiceWorker(
62 context_->controller()->info(), false)); 67 context_->controller()->info(), false));
63 } 68 }
64 } 69 }
65 70
66 void WebServiceWorkerProviderImpl::registerServiceWorker( 71 void WebServiceWorkerProviderImpl::registerServiceWorker(
67 const WebURL& pattern, 72 const WebURL& pattern,
68 const WebURL& script_url, 73 const WebURL& script_url,
69 WebServiceWorkerCallbacks* callbacks) { 74 WebServiceWorkerCallbacks* callbacks) {
(...skipping 16 matching lines...) Expand all
86 if (dispatcher) 91 if (dispatcher)
87 dispatcher->RemoveScriptClient(provider_id_); 92 dispatcher->RemoveScriptClient(provider_id_);
88 } 93 }
89 94
90 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { 95 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() {
91 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( 96 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance(
92 thread_safe_sender_); 97 thread_safe_sender_);
93 } 98 }
94 99
95 } // namespace content 100 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698