OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <utility> | 10 #include <utility> |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // if it contains a message port and sending it a valid route id. | 178 // if it contains a message port and sending it a valid route id. |
179 void RelayMessage(const IPC::Message& message, | 179 void RelayMessage(const IPC::Message& message, |
180 WorkerMessageFilter* filter, | 180 WorkerMessageFilter* filter, |
181 int route_id); | 181 int route_id); |
182 | 182 |
183 virtual bool CanShutdown() OVERRIDE; | 183 virtual bool CanShutdown() OVERRIDE; |
184 | 184 |
185 // Updates the title shown in the task manager. | 185 // Updates the title shown in the task manager. |
186 void UpdateTitle(); | 186 void UpdateTitle(); |
187 | 187 |
| 188 // Return a vector of all the render process/render view IDs that use the |
| 189 // given worker. |
| 190 std::vector<std::pair<int, int> > GetRenderViewIDsForWorker(int route_id); |
| 191 |
188 Instances instances_; | 192 Instances instances_; |
189 | 193 |
190 const content::ResourceContext* const resource_context_; | 194 const content::ResourceContext* const resource_context_; |
191 | 195 |
192 // A reference to the filter associated with this worker process. We need to | 196 // A reference to the filter associated with this worker process. We need to |
193 // keep this around since we'll use it when forward messages to the worker | 197 // keep this around since we'll use it when forward messages to the worker |
194 // process. | 198 // process. |
195 scoped_refptr<WorkerMessageFilter> worker_message_filter_; | 199 scoped_refptr<WorkerMessageFilter> worker_message_filter_; |
196 | 200 |
197 scoped_ptr<BrowserChildProcessHostImpl> process_; | 201 scoped_ptr<BrowserChildProcessHostImpl> process_; |
198 | 202 |
199 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); | 203 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); |
200 }; | 204 }; |
201 | 205 |
202 class WorkerProcessHostIterator | 206 class WorkerProcessHostIterator |
203 : public content::BrowserChildProcessHostTypeIterator<WorkerProcessHost> { | 207 : public content::BrowserChildProcessHostTypeIterator<WorkerProcessHost> { |
204 public: | 208 public: |
205 WorkerProcessHostIterator() | 209 WorkerProcessHostIterator() |
206 : content::BrowserChildProcessHostTypeIterator<WorkerProcessHost>( | 210 : content::BrowserChildProcessHostTypeIterator<WorkerProcessHost>( |
207 content::PROCESS_TYPE_WORKER) { | 211 content::PROCESS_TYPE_WORKER) { |
208 } | 212 } |
209 }; | 213 }; |
210 | 214 |
211 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 215 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
OLD | NEW |