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 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "content/browser/browser_child_process_host.h" | 13 #include "content/browser/browser_child_process_host.h" |
14 #include "content/browser/worker_host/worker_document_set.h" | 14 #include "content/browser/worker_host/worker_document_set.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 | 16 |
17 class ResourceDispatcherHost; | 17 class ResourceDispatcherHost; |
18 namespace content { | 18 namespace content { |
19 class ResourceContext; | 19 class ResourceContext; |
20 } // namespace content | 20 } // namespace content |
21 namespace net { | 21 namespace net { |
22 class URLRequestContextGetter; | 22 class URLRequestContextGetter; |
23 } // namespace net | 23 } // namespace net |
24 | 24 |
25 // The WorkerProcessHost is the interface that represents the browser side of | 25 // The WorkerProcessHost is the interface that represents the browser side of |
26 // the browser <-> worker communication channel. There will be one | 26 // the browser <-> worker communication channel. There will be one |
27 // WorkerProcessHost per worker process. Currently each worker runs in its own | 27 // WorkerProcessHost per worker process. Currently each worker runs in its own |
28 // process, but that may change. However, we do assume (by storing a | 28 // process, but that may change. However, we do assume (by storing a |
29 // net::URLRequestContext) that a WorkerProcessHost serves a single Profile. | 29 // net::URLRequestContext) that a WorkerProcessHost serves a single |
| 30 // BrowserContext. |
30 class WorkerProcessHost : public BrowserChildProcessHost { | 31 class WorkerProcessHost : public BrowserChildProcessHost { |
31 public: | 32 public: |
32 | 33 |
33 // Contains information about each worker instance, needed to forward messages | 34 // Contains information about each worker instance, needed to forward messages |
34 // between the renderer and worker processes. | 35 // between the renderer and worker processes. |
35 class WorkerInstance { | 36 class WorkerInstance { |
36 public: | 37 public: |
37 WorkerInstance(const GURL& url, | 38 WorkerInstance(const GURL& url, |
38 bool shared, | 39 bool shared, |
39 const string16& name, | 40 const string16& name, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // keep this around since we'll use it when forward messages to the worker | 192 // keep this around since we'll use it when forward messages to the worker |
192 // process. | 193 // process. |
193 scoped_refptr<WorkerMessageFilter> worker_message_filter_; | 194 scoped_refptr<WorkerMessageFilter> worker_message_filter_; |
194 | 195 |
195 ResourceDispatcherHost* const resource_dispatcher_host_; | 196 ResourceDispatcherHost* const resource_dispatcher_host_; |
196 | 197 |
197 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); | 198 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); |
198 }; | 199 }; |
199 | 200 |
200 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 201 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
OLD | NEW |