| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 const bool is_new_worker_; | 214 const bool is_new_worker_; |
| 215 const SharedWorkerInstance instance_; | 215 const SharedWorkerInstance instance_; |
| 216 }; | 216 }; |
| 217 | 217 |
| 218 // static | 218 // static |
| 219 bool (*SharedWorkerServiceImpl::s_try_increment_worker_ref_count_)(int) = | 219 bool (*SharedWorkerServiceImpl::s_try_increment_worker_ref_count_)(int) = |
| 220 TryIncrementWorkerRefCount; | 220 TryIncrementWorkerRefCount; |
| 221 | 221 |
| 222 SharedWorkerServiceImpl* SharedWorkerServiceImpl::GetInstance() { | 222 SharedWorkerServiceImpl* SharedWorkerServiceImpl::GetInstance() { |
| 223 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 223 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 224 return Singleton<SharedWorkerServiceImpl>::get(); | 224 return base::Singleton<SharedWorkerServiceImpl>::get(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 SharedWorkerServiceImpl::SharedWorkerServiceImpl() | 227 SharedWorkerServiceImpl::SharedWorkerServiceImpl() |
| 228 : update_worker_dependency_(UpdateWorkerDependency), | 228 : update_worker_dependency_(UpdateWorkerDependency), |
| 229 next_pending_instance_id_(0) { | 229 next_pending_instance_id_(0) { |
| 230 } | 230 } |
| 231 | 231 |
| 232 SharedWorkerServiceImpl::~SharedWorkerServiceImpl() {} | 232 SharedWorkerServiceImpl::~SharedWorkerServiceImpl() {} |
| 233 | 233 |
| 234 void SharedWorkerServiceImpl::ResetForTesting() { | 234 void SharedWorkerServiceImpl::ResetForTesting() { |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 UpdateWorkerDependencyFunc new_func) { | 660 UpdateWorkerDependencyFunc new_func) { |
| 661 update_worker_dependency_ = new_func; | 661 update_worker_dependency_ = new_func; |
| 662 } | 662 } |
| 663 | 663 |
| 664 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( | 664 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( |
| 665 bool (*new_func)(int)) { | 665 bool (*new_func)(int)) { |
| 666 s_try_increment_worker_ref_count_ = new_func; | 666 s_try_increment_worker_ref_count_ = new_func; |
| 667 } | 667 } |
| 668 | 668 |
| 669 } // namespace content | 669 } // namespace content |
| OLD | NEW |