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> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "content/browser/browser_child_process_host.h" | 14 #include "content/browser/browser_child_process_host.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/browser/worker_host/worker_document_set.h" | 16 #include "content/browser/worker_host/worker_document_set.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 | 18 |
19 class ResourceDispatcherHost; | |
20 | |
21 namespace content { | 19 namespace content { |
22 class ResourceContext; | 20 class ResourceContext; |
23 class WorkerServiceImpl; | 21 class WorkerServiceImpl; |
24 } // namespace content | 22 } // namespace content |
25 | 23 |
26 // The WorkerProcessHost is the interface that represents the browser side of | 24 // The WorkerProcessHost is the interface that represents the browser side of |
27 // the browser <-> worker communication channel. There will be one | 25 // the browser <-> worker communication channel. There will be one |
28 // WorkerProcessHost per worker process. Currently each worker runs in its own | 26 // WorkerProcessHost per worker process. Currently each worker runs in its own |
29 // process, but that may change. However, we do assume (by storing a | 27 // process, but that may change. However, we do assume (by storing a |
30 // net::URLRequestContext) that a WorkerProcessHost serves a single | 28 // net::URLRequestContext) that a WorkerProcessHost serves a single |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bool closed_; | 100 bool closed_; |
103 string16 name_; | 101 string16 name_; |
104 int worker_route_id_; | 102 int worker_route_id_; |
105 int parent_process_id_; | 103 int parent_process_id_; |
106 int64 main_resource_appcache_id_; | 104 int64 main_resource_appcache_id_; |
107 FilterList filters_; | 105 FilterList filters_; |
108 scoped_refptr<WorkerDocumentSet> worker_document_set_; | 106 scoped_refptr<WorkerDocumentSet> worker_document_set_; |
109 const content::ResourceContext* const resource_context_; | 107 const content::ResourceContext* const resource_context_; |
110 }; | 108 }; |
111 | 109 |
112 WorkerProcessHost( | 110 explicit WorkerProcessHost(const content::ResourceContext* resource_context); |
113 const content::ResourceContext* resource_context, | |
114 ResourceDispatcherHost* resource_dispatcher_host); | |
115 virtual ~WorkerProcessHost(); | 111 virtual ~WorkerProcessHost(); |
116 | 112 |
117 // Starts the process. Returns true iff it succeeded. | 113 // Starts the process. Returns true iff it succeeded. |
118 // |render_process_id| is the renderer process responsible for starting this | 114 // |render_process_id| is the renderer process responsible for starting this |
119 // worker. | 115 // worker. |
120 bool Init(int render_process_id); | 116 bool Init(int render_process_id); |
121 | 117 |
122 // Creates a worker object in the process. | 118 // Creates a worker object in the process. |
123 void CreateWorker(const WorkerInstance& instance); | 119 void CreateWorker(const WorkerInstance& instance); |
124 | 120 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 179 |
184 Instances instances_; | 180 Instances instances_; |
185 | 181 |
186 const content::ResourceContext* const resource_context_; | 182 const content::ResourceContext* const resource_context_; |
187 | 183 |
188 // A reference to the filter associated with this worker process. We need to | 184 // A reference to the filter associated with this worker process. We need to |
189 // keep this around since we'll use it when forward messages to the worker | 185 // keep this around since we'll use it when forward messages to the worker |
190 // process. | 186 // process. |
191 scoped_refptr<WorkerMessageFilter> worker_message_filter_; | 187 scoped_refptr<WorkerMessageFilter> worker_message_filter_; |
192 | 188 |
193 ResourceDispatcherHost* const resource_dispatcher_host_; | |
194 | |
195 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); | 189 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); |
196 }; | 190 }; |
197 | 191 |
198 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 192 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
OLD | NEW |