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

Side by Side Diff: content/browser/shared_worker/shared_worker_service_impl.cc

Issue 2586863002: Worker: Enable UseCounter for SharedWorkerGlobalScope (Closed)
Patch Set: ready to review 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/browser/shared_worker/shared_worker_service_impl.h" 5 #include "content/browser/shared_worker/shared_worker_service_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 SharedWorkerMessageFilter* filter, 340 SharedWorkerMessageFilter* filter,
341 unsigned long long document_id) { 341 unsigned long long document_id) {
342 ScopedWorkerDependencyChecker checker(this); 342 ScopedWorkerDependencyChecker checker(this);
343 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin(); 343 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin();
344 iter != worker_hosts_.end(); 344 iter != worker_hosts_.end();
345 ++iter) { 345 ++iter) {
346 iter->second->DocumentDetached(filter, document_id); 346 iter->second->DocumentDetached(filter, document_id);
347 } 347 }
348 } 348 }
349 349
350 void SharedWorkerServiceImpl::CountFeature(SharedWorkerMessageFilter* filter,
351 int worker_route_id,
352 uint32_t feature) {
353 ScopedWorkerDependencyChecker checker(this);
horo 2017/01/25 03:45:10 You don't need this?
nhiroki 2017/01/25 10:16:11 Done.
354 if (SharedWorkerHost* host =
355 FindSharedWorkerHost(filter->render_process_id(), worker_route_id))
horo 2017/01/25 03:45:10 nit: brackets
nhiroki 2017/01/25 10:16:11 Done.
356 host->CountFeature(feature);
357 }
358
350 void SharedWorkerServiceImpl::WorkerContextClosed( 359 void SharedWorkerServiceImpl::WorkerContextClosed(
351 SharedWorkerMessageFilter* filter, 360 SharedWorkerMessageFilter* filter,
352 int worker_route_id) { 361 int worker_route_id) {
353 ScopedWorkerDependencyChecker checker(this); 362 ScopedWorkerDependencyChecker checker(this);
354 if (SharedWorkerHost* host = 363 if (SharedWorkerHost* host =
355 FindSharedWorkerHost(filter->render_process_id(), worker_route_id)) 364 FindSharedWorkerHost(filter->render_process_id(), worker_route_id))
356 host->WorkerContextClosed(); 365 host->WorkerContextClosed();
357 } 366 }
358 367
359 void SharedWorkerServiceImpl::WorkerContextDestroyed( 368 void SharedWorkerServiceImpl::WorkerContextDestroyed(
360 SharedWorkerMessageFilter* filter, 369 SharedWorkerMessageFilter* filter,
361 int worker_route_id) { 370 int worker_route_id) {
362 ScopedWorkerDependencyChecker checker(this); 371 ScopedWorkerDependencyChecker checker(this);
372 if (SharedWorkerHost* host =
373 FindSharedWorkerHost(filter->render_process_id(), worker_route_id))
horo 2017/01/25 03:45:10 nit: brackets
nhiroki 2017/01/25 10:16:11 Done.
374 host->WorkerContextDestroyed();
363 ProcessRouteIdPair key(filter->render_process_id(), worker_route_id); 375 ProcessRouteIdPair key(filter->render_process_id(), worker_route_id);
364 worker_hosts_.erase(key); 376 worker_hosts_.erase(key);
365 } 377 }
366 378
367 void SharedWorkerServiceImpl::WorkerReadyForInspection( 379 void SharedWorkerServiceImpl::WorkerReadyForInspection(
368 SharedWorkerMessageFilter* filter, 380 SharedWorkerMessageFilter* filter,
369 int worker_route_id) { 381 int worker_route_id) {
370 if (SharedWorkerHost* host = 382 if (SharedWorkerHost* host =
371 FindSharedWorkerHost(filter->render_process_id(), worker_route_id)) 383 FindSharedWorkerHost(filter->render_process_id(), worker_route_id))
372 host->WorkerReadyForInspection(); 384 host->WorkerReadyForInspection();
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 UpdateWorkerDependencyFunc new_func) { 678 UpdateWorkerDependencyFunc new_func) {
667 update_worker_dependency_ = new_func; 679 update_worker_dependency_ = new_func;
668 } 680 }
669 681
670 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( 682 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting(
671 bool (*new_func)(int)) { 683 bool (*new_func)(int)) {
672 s_try_increment_worker_ref_count_ = new_func; 684 s_try_increment_worker_ref_count_ = new_func;
673 } 685 }
674 686
675 } // namespace content 687 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698