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

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

Issue 2364113003: Reland of Check that all shared workers are terminated. (patchset #2 id:170001 of https://c… (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « content/browser/shared_worker/shared_worker_service_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 } 467 }
468 } 468 }
469 469
470 void SharedWorkerServiceImpl::NotifyWorkerDestroyed(int worker_process_id, 470 void SharedWorkerServiceImpl::NotifyWorkerDestroyed(int worker_process_id,
471 int worker_route_id) { 471 int worker_route_id) {
472 FOR_EACH_OBSERVER(WorkerServiceObserver, 472 FOR_EACH_OBSERVER(WorkerServiceObserver,
473 observers_, 473 observers_,
474 WorkerDestroyed(worker_process_id, worker_route_id)); 474 WorkerDestroyed(worker_process_id, worker_route_id));
475 } 475 }
476 476
477 // TODO(alokp): Remove after collecting crash data.
478 // Temporary checks to verify that all shared workers are terminated.
479 // It is suspected that shared workers prevent render process hosts
480 // from shutting down: crbug.com/608049
481 void SharedWorkerServiceImpl::CheckAllWorkersTerminated() {
482 std::set<int> dependent_renderers = GetRenderersWithWorkerDependency();
483 CHECK_EQ(0u, dependent_renderers.size());
484 }
485
477 blink::WebWorkerCreationError 486 blink::WebWorkerCreationError
478 SharedWorkerServiceImpl::ReserveRenderProcessToCreateWorker( 487 SharedWorkerServiceImpl::ReserveRenderProcessToCreateWorker(
479 std::unique_ptr<SharedWorkerPendingInstance> pending_instance) { 488 std::unique_ptr<SharedWorkerPendingInstance> pending_instance) {
480 DCHECK_CURRENTLY_ON(BrowserThread::IO); 489 DCHECK_CURRENTLY_ON(BrowserThread::IO);
481 DCHECK(!FindPendingInstance(*pending_instance->instance())); 490 DCHECK(!FindPendingInstance(*pending_instance->instance()));
482 if (!pending_instance->requests()->size()) 491 if (!pending_instance->requests()->size())
483 return blink::WebWorkerCreationErrorNone; 492 return blink::WebWorkerCreationErrorNone;
484 493
485 int worker_process_id = -1; 494 int worker_process_id = -1;
486 int worker_route_id = MSG_ROUTING_NONE; 495 int worker_route_id = MSG_ROUTING_NONE;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 UpdateWorkerDependencyFunc new_func) { 683 UpdateWorkerDependencyFunc new_func) {
675 update_worker_dependency_ = new_func; 684 update_worker_dependency_ = new_func;
676 } 685 }
677 686
678 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( 687 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting(
679 bool (*new_func)(int)) { 688 bool (*new_func)(int)) {
680 s_try_increment_worker_ref_count_ = new_func; 689 s_try_increment_worker_ref_count_ = new_func;
681 } 690 }
682 691
683 } // namespace content 692 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/shared_worker/shared_worker_service_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698