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 <set> | 8 #include <set> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 SharedWorkerServiceImpl(); | 102 SharedWorkerServiceImpl(); |
103 virtual ~SharedWorkerServiceImpl(); | 103 virtual ~SharedWorkerServiceImpl(); |
104 | 104 |
105 void ResetForTesting(); | 105 void ResetForTesting(); |
106 | 106 |
107 SharedWorkerHost* FindSharedWorkerHost( | 107 SharedWorkerHost* FindSharedWorkerHost( |
108 SharedWorkerMessageFilter* filter, | 108 SharedWorkerMessageFilter* filter, |
109 int worker_route_id); | 109 int worker_route_id); |
110 | 110 |
111 SharedWorkerInstance* FindSharedWorkerInstance( | 111 SharedWorkerHost* FindSharedWorkerHost( |
112 const GURL& url, | 112 const GURL& url, |
113 const base::string16& name, | 113 const base::string16& name, |
114 const WorkerStoragePartition& worker_partition, | 114 const WorkerStoragePartition& worker_partition, |
115 ResourceContext* resource_context); | 115 ResourceContext* resource_context); |
116 | 116 |
117 // Returns the IDs of the renderer processes which are executing | 117 // Returns the IDs of the renderer processes which are executing |
118 // SharedWorkers connected to other renderer processes. | 118 // SharedWorkers connected to other renderer processes. |
119 const std::set<int> GetRenderersWithWorkerDependency(); | 119 const std::set<int> GetRenderersWithWorkerDependency(); |
120 | 120 |
121 void ChangeUpdateWorkerDependencyFuncForTesting( | 121 void ChangeUpdateWorkerDependencyFuncForTesting( |
122 UpdateWorkerDependencyFunc new_func); | 122 UpdateWorkerDependencyFunc new_func); |
123 | 123 |
124 std::set<int> last_worker_depended_renderers_; | 124 std::set<int> last_worker_depended_renderers_; |
125 UpdateWorkerDependencyFunc update_worker_dependency_; | 125 UpdateWorkerDependencyFunc update_worker_dependency_; |
126 | 126 |
127 // Pair of render_process_id and worker_route_id. | 127 // Pair of render_process_id and worker_route_id. |
128 typedef std::pair<int, int> ProcessRouteIdPair; | 128 typedef std::pair<int, int> ProcessRouteIdPair; |
129 typedef base::ScopedPtrHashMap<ProcessRouteIdPair, | 129 typedef base::ScopedPtrHashMap<ProcessRouteIdPair, |
130 SharedWorkerHost> WorkerHostMap; | 130 SharedWorkerHost> WorkerHostMap; |
131 WorkerHostMap worker_hosts_; | 131 WorkerHostMap worker_hosts_; |
132 | 132 |
133 ObserverList<WorkerServiceObserver> observers_; | 133 ObserverList<WorkerServiceObserver> observers_; |
134 | 134 |
135 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); | 135 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); |
136 }; | 136 }; |
137 | 137 |
138 } // namespace content | 138 } // namespace content |
139 | 139 |
140 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ | 140 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
OLD | NEW |