| 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 #ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 void OnSharedWorkerMessageFilterClosing( | 86 void OnSharedWorkerMessageFilterClosing( |
| 87 SharedWorkerMessageFilter* filter); | 87 SharedWorkerMessageFilter* filter); |
| 88 | 88 |
| 89 // Checks the worker dependency of renderer processes and calls | 89 // Checks the worker dependency of renderer processes and calls |
| 90 // IncrementWorkerRefCount and DecrementWorkerRefCount of | 90 // IncrementWorkerRefCount and DecrementWorkerRefCount of |
| 91 // RenderProcessHostImpl on UI thread if necessary. | 91 // RenderProcessHostImpl on UI thread if necessary. |
| 92 void CheckWorkerDependency(); | 92 void CheckWorkerDependency(); |
| 93 | 93 |
| 94 void NotifyWorkerDestroyed(int worker_process_id, int worker_route_id); | 94 void NotifyWorkerDestroyed(int worker_process_id, int worker_route_id); |
| 95 | 95 |
| 96 // TODO(alokp): Remove after collecting crash data. | |
| 97 // Temporary checks to verify that all shared workers are terminated. | |
| 98 // It is suspected that shared workers prevent render process hosts | |
| 99 // from shutting down: crbug.com/608049 | |
| 100 void CheckAllWorkersTerminated(); | |
| 101 | |
| 102 private: | 96 private: |
| 103 class SharedWorkerPendingInstance; | 97 class SharedWorkerPendingInstance; |
| 104 class SharedWorkerReserver; | 98 class SharedWorkerReserver; |
| 105 | 99 |
| 106 friend struct base::DefaultSingletonTraits<SharedWorkerServiceImpl>; | 100 friend struct base::DefaultSingletonTraits<SharedWorkerServiceImpl>; |
| 107 friend class SharedWorkerServiceImplTest; | 101 friend class SharedWorkerServiceImplTest; |
| 108 | 102 |
| 109 using UpdateWorkerDependencyFunc = void (*)(const std::vector<int>&, | 103 using UpdateWorkerDependencyFunc = void (*)(const std::vector<int>&, |
| 110 const std::vector<int>&); | 104 const std::vector<int>&); |
| 111 using TryIncrementWorkerRefCountFunc = bool (*)(bool); | 105 using TryIncrementWorkerRefCountFunc = bool (*)(bool); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 int next_pending_instance_id_; | 169 int next_pending_instance_id_; |
| 176 | 170 |
| 177 base::ObserverList<WorkerServiceObserver> observers_; | 171 base::ObserverList<WorkerServiceObserver> observers_; |
| 178 | 172 |
| 179 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); | 173 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); |
| 180 }; | 174 }; |
| 181 | 175 |
| 182 } // namespace content | 176 } // namespace content |
| 183 | 177 |
| 184 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ | 178 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
| OLD | NEW |