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

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

Issue 2286003002: Reland of Check that all shared workers are terminated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 pending_instances_.erase(to_remove); 439 pending_instances_.erase(to_remove);
440 } 440 }
441 441
442 void SharedWorkerServiceImpl::NotifyWorkerDestroyed(int worker_process_id, 442 void SharedWorkerServiceImpl::NotifyWorkerDestroyed(int worker_process_id,
443 int worker_route_id) { 443 int worker_route_id) {
444 FOR_EACH_OBSERVER(WorkerServiceObserver, 444 FOR_EACH_OBSERVER(WorkerServiceObserver,
445 observers_, 445 observers_,
446 WorkerDestroyed(worker_process_id, worker_route_id)); 446 WorkerDestroyed(worker_process_id, worker_route_id));
447 } 447 }
448 448
449 // TODO(alokp): Remove after collecting crash data.
450 // Temporary checks to verify that all shared workers are terminated.
451 // It is suspected that shared workers prevent render process hosts
452 // from shutting down: crbug.com/608049
453 void SharedWorkerServiceImpl::CheckAllWorkersTerminated() {
454 std::set<int> dependent_renderers = GetRenderersWithWorkerDependency();
455 CHECK_EQ(0u, dependent_renderers.size());
456 }
457
449 blink::WebWorkerCreationError 458 blink::WebWorkerCreationError
450 SharedWorkerServiceImpl::ReserveRenderProcessToCreateWorker( 459 SharedWorkerServiceImpl::ReserveRenderProcessToCreateWorker(
451 std::unique_ptr<SharedWorkerPendingInstance> pending_instance) { 460 std::unique_ptr<SharedWorkerPendingInstance> pending_instance) {
452 DCHECK_CURRENTLY_ON(BrowserThread::IO); 461 DCHECK_CURRENTLY_ON(BrowserThread::IO);
453 DCHECK(!FindPendingInstance(*pending_instance->instance())); 462 DCHECK(!FindPendingInstance(*pending_instance->instance()));
454 if (!pending_instance->requests()->size()) 463 if (!pending_instance->requests()->size())
455 return blink::WebWorkerCreationErrorNone; 464 return blink::WebWorkerCreationErrorNone;
456 465
457 int worker_process_id = -1; 466 int worker_process_id = -1;
458 int worker_route_id = MSG_ROUTING_NONE; 467 int worker_route_id = MSG_ROUTING_NONE;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 UpdateWorkerDependencyFunc new_func) { 655 UpdateWorkerDependencyFunc new_func) {
647 update_worker_dependency_ = new_func; 656 update_worker_dependency_ = new_func;
648 } 657 }
649 658
650 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( 659 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting(
651 bool (*new_func)(int)) { 660 bool (*new_func)(int)) {
652 s_try_increment_worker_ref_count_ = new_func; 661 s_try_increment_worker_ref_count_ = new_func;
653 } 662 }
654 663
655 } // namespace content 664 } // 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