OLD | NEW |
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 unsigned long long document_id, | 325 unsigned long long document_id, |
326 SharedWorkerMessageFilter* filter) { | 326 SharedWorkerMessageFilter* filter) { |
327 ScopedWorkerDependencyChecker checker(this); | 327 ScopedWorkerDependencyChecker checker(this); |
328 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin(); | 328 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin(); |
329 iter != worker_hosts_.end(); | 329 iter != worker_hosts_.end(); |
330 ++iter) { | 330 ++iter) { |
331 iter->second->DocumentDetached(filter, document_id); | 331 iter->second->DocumentDetached(filter, document_id); |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
| 335 void SharedWorkerServiceImpl::DetachAllDocuments( |
| 336 SharedWorkerMessageFilter* filter) { |
| 337 ScopedWorkerDependencyChecker checker(this); |
| 338 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin(); |
| 339 iter != worker_hosts_.end(); ++iter) { |
| 340 iter->second->DetachAllDocuments(filter); |
| 341 } |
| 342 } |
| 343 |
335 void SharedWorkerServiceImpl::WorkerContextClosed( | 344 void SharedWorkerServiceImpl::WorkerContextClosed( |
336 int worker_route_id, | 345 int worker_route_id, |
337 SharedWorkerMessageFilter* filter) { | 346 SharedWorkerMessageFilter* filter) { |
338 ScopedWorkerDependencyChecker checker(this); | 347 ScopedWorkerDependencyChecker checker(this); |
339 if (SharedWorkerHost* host = | 348 if (SharedWorkerHost* host = |
340 FindSharedWorkerHost(filter->render_process_id(), worker_route_id)) | 349 FindSharedWorkerHost(filter->render_process_id(), worker_route_id)) |
341 host->WorkerContextClosed(); | 350 host->WorkerContextClosed(); |
342 } | 351 } |
343 | 352 |
344 void SharedWorkerServiceImpl::WorkerContextDestroyed( | 353 void SharedWorkerServiceImpl::WorkerContextDestroyed( |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 UpdateWorkerDependencyFunc new_func) { | 664 UpdateWorkerDependencyFunc new_func) { |
656 update_worker_dependency_ = new_func; | 665 update_worker_dependency_ = new_func; |
657 } | 666 } |
658 | 667 |
659 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( | 668 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( |
660 bool (*new_func)(int)) { | 669 bool (*new_func)(int)) { |
661 s_try_increment_worker_ref_count_ = new_func; | 670 s_try_increment_worker_ref_count_ = new_func; |
662 } | 671 } |
663 | 672 |
664 } // namespace content | 673 } // namespace content |
OLD | NEW |