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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // referenced by active documents. | 91 // referenced by active documents. |
92 void RenderFrameDetached(int render_process_id, int render_frame_id); | 92 void RenderFrameDetached(int render_process_id, int render_frame_id); |
93 | 93 |
94 // Checks the worker dependency of renderer processes and calls | 94 // Checks the worker dependency of renderer processes and calls |
95 // IncrementWorkerRefCount and DecrementWorkerRefCount of | 95 // IncrementWorkerRefCount and DecrementWorkerRefCount of |
96 // RenderProcessHostImpl on UI thread if necessary. | 96 // RenderProcessHostImpl on UI thread if necessary. |
97 void CheckWorkerDependency(); | 97 void CheckWorkerDependency(); |
98 | 98 |
99 void NotifyWorkerDestroyed(int worker_process_id, int worker_route_id); | 99 void NotifyWorkerDestroyed(int worker_process_id, int worker_route_id); |
100 | 100 |
| 101 // TODO(alokp): Remove after collecting crash data. |
| 102 // Temporary checks to verify that all shared workers are terminated. |
| 103 // It is suspected that shared workers prevent render process hosts |
| 104 // from shutting down: crbug.com/608049 |
| 105 void CheckAllWorkersTerminated(); |
| 106 |
101 private: | 107 private: |
102 class SharedWorkerPendingInstance; | 108 class SharedWorkerPendingInstance; |
103 class SharedWorkerReserver; | 109 class SharedWorkerReserver; |
104 | 110 |
105 friend struct base::DefaultSingletonTraits<SharedWorkerServiceImpl>; | 111 friend struct base::DefaultSingletonTraits<SharedWorkerServiceImpl>; |
106 friend class SharedWorkerServiceImplTest; | 112 friend class SharedWorkerServiceImplTest; |
107 | 113 |
108 using UpdateWorkerDependencyFunc = void (*)(const std::vector<int>&, | 114 using UpdateWorkerDependencyFunc = void (*)(const std::vector<int>&, |
109 const std::vector<int>&); | 115 const std::vector<int>&); |
110 using TryIncrementWorkerRefCountFunc = bool (*)(bool); | 116 using TryIncrementWorkerRefCountFunc = bool (*)(bool); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 int next_pending_instance_id_; | 180 int next_pending_instance_id_; |
175 | 181 |
176 base::ObserverList<WorkerServiceObserver> observers_; | 182 base::ObserverList<WorkerServiceObserver> observers_; |
177 | 183 |
178 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); | 184 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); |
179 }; | 185 }; |
180 | 186 |
181 } // namespace content | 187 } // namespace content |
182 | 188 |
183 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ | 189 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
OLD | NEW |