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

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

Issue 2658603003: ServiceWorker: Enable UseCounter for ServiceWorkerGlobalScope (Closed)
Patch Set: tweak unittests Created 3 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/service_worker_provider_context.h" 5 #include "content/child/service_worker/service_worker_provider_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 std::move(installing), std::move(waiting), 180 std::move(installing), std::move(waiting),
181 std::move(active)); 181 std::move(active));
182 } 182 }
183 183
184 void ServiceWorkerProviderContext::OnDisassociateRegistration() { 184 void ServiceWorkerProviderContext::OnDisassociateRegistration() {
185 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread()); 185 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
186 delegate_->DisassociateRegistration(); 186 delegate_->DisassociateRegistration();
187 } 187 }
188 188
189 void ServiceWorkerProviderContext::OnSetControllerServiceWorker( 189 void ServiceWorkerProviderContext::OnSetControllerServiceWorker(
190 std::unique_ptr<ServiceWorkerHandleReference> controller) { 190 std::unique_ptr<ServiceWorkerHandleReference> controller,
191 const std::set<uint32_t>& used_features) {
191 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread()); 192 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
192 delegate_->SetController(std::move(controller)); 193 delegate_->SetController(std::move(controller));
194 used_features_ = used_features;
193 } 195 }
194 196
195 void ServiceWorkerProviderContext::GetAssociatedRegistration( 197 void ServiceWorkerProviderContext::GetAssociatedRegistration(
196 ServiceWorkerRegistrationObjectInfo* info, 198 ServiceWorkerRegistrationObjectInfo* info,
197 ServiceWorkerVersionAttributes* attrs) { 199 ServiceWorkerVersionAttributes* attrs) {
198 DCHECK(!main_thread_task_runner_->RunsTasksOnCurrentThread()); 200 DCHECK(!main_thread_task_runner_->RunsTasksOnCurrentThread());
199 delegate_->GetAssociatedRegistration(info, attrs); 201 delegate_->GetAssociatedRegistration(info, attrs);
200 } 202 }
201 203
202 bool ServiceWorkerProviderContext::HasAssociatedRegistration() { 204 bool ServiceWorkerProviderContext::HasAssociatedRegistration() {
203 return delegate_->HasAssociatedRegistration(); 205 return delegate_->HasAssociatedRegistration();
204 } 206 }
205 207
206 ServiceWorkerHandleReference* ServiceWorkerProviderContext::controller() { 208 ServiceWorkerHandleReference* ServiceWorkerProviderContext::controller() {
207 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread()); 209 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
208 return delegate_->controller(); 210 return delegate_->controller();
209 } 211 }
210 212
211 void ServiceWorkerProviderContext::DestructOnMainThread() const { 213 void ServiceWorkerProviderContext::DestructOnMainThread() const {
212 if (!main_thread_task_runner_->RunsTasksOnCurrentThread() && 214 if (!main_thread_task_runner_->RunsTasksOnCurrentThread() &&
213 main_thread_task_runner_->DeleteSoon(FROM_HERE, this)) { 215 main_thread_task_runner_->DeleteSoon(FROM_HERE, this)) {
214 return; 216 return;
215 } 217 }
216 delete this; 218 delete this;
217 } 219 }
218 220
219 } // namespace content 221 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698