| 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; | 19 class ResourceDispatcherHost; |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 class ResourceContext; | 22 class ResourceContext; |
| 23 class WorkerServiceImpl; |
| 23 } // namespace content | 24 } // namespace content |
| 24 | 25 |
| 25 // The WorkerProcessHost is the interface that represents the browser side of | 26 // The WorkerProcessHost is the interface that represents the browser side of |
| 26 // the browser <-> worker communication channel. There will be one | 27 // the browser <-> worker communication channel. There will be one |
| 27 // WorkerProcessHost per worker process. Currently each worker runs in its own | 28 // WorkerProcessHost per worker process. Currently each worker runs in its own |
| 28 // process, but that may change. However, we do assume (by storing a | 29 // process, but that may change. However, we do assume (by storing a |
| 29 // net::URLRequestContext) that a WorkerProcessHost serves a single | 30 // net::URLRequestContext) that a WorkerProcessHost serves a single |
| 30 // BrowserContext. | 31 // BrowserContext. |
| 31 class WorkerProcessHost : public BrowserChildProcessHost { | 32 class WorkerProcessHost : public BrowserChildProcessHost { |
| 32 public: | 33 public: |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 CONTENT_EXPORT void TerminateWorker(int worker_route_id); | 137 CONTENT_EXPORT void TerminateWorker(int worker_route_id); |
| 137 | 138 |
| 138 typedef std::list<WorkerInstance> Instances; | 139 typedef std::list<WorkerInstance> Instances; |
| 139 const Instances& instances() const { return instances_; } | 140 const Instances& instances() const { return instances_; } |
| 140 | 141 |
| 141 const content::ResourceContext* resource_context() const { | 142 const content::ResourceContext* resource_context() const { |
| 142 return resource_context_; | 143 return resource_context_; |
| 143 } | 144 } |
| 144 | 145 |
| 145 protected: | 146 protected: |
| 146 friend class WorkerService; | 147 friend class content::WorkerServiceImpl; |
| 147 | 148 |
| 148 Instances& mutable_instances() { return instances_; } | 149 Instances& mutable_instances() { return instances_; } |
| 149 | 150 |
| 150 private: | 151 private: |
| 151 // Called when the process has been launched successfully. | 152 // Called when the process has been launched successfully. |
| 152 virtual void OnProcessLaunched() OVERRIDE; | 153 virtual void OnProcessLaunched() OVERRIDE; |
| 153 | 154 |
| 154 // Creates and adds the message filters. | 155 // Creates and adds the message filters. |
| 155 void CreateMessageFilters(int render_process_id); | 156 void CreateMessageFilters(int render_process_id); |
| 156 | 157 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // keep this around since we'll use it when forward messages to the worker | 189 // keep this around since we'll use it when forward messages to the worker |
| 189 // process. | 190 // process. |
| 190 scoped_refptr<WorkerMessageFilter> worker_message_filter_; | 191 scoped_refptr<WorkerMessageFilter> worker_message_filter_; |
| 191 | 192 |
| 192 ResourceDispatcherHost* const resource_dispatcher_host_; | 193 ResourceDispatcherHost* const resource_dispatcher_host_; |
| 193 | 194 |
| 194 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); | 195 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); |
| 195 }; | 196 }; |
| 196 | 197 |
| 197 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 198 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
| OLD | NEW |