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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 return resource_context_; | 142 return resource_context_; |
143 } | 143 } |
144 | 144 |
145 protected: | 145 protected: |
146 friend class WorkerService; | 146 friend class WorkerService; |
147 | 147 |
148 Instances& mutable_instances() { return instances_; } | 148 Instances& mutable_instances() { return instances_; } |
149 | 149 |
150 private: | 150 private: |
151 // Called when the process has been launched successfully. | 151 // Called when the process has been launched successfully. |
152 virtual void OnProcessLaunched(); | 152 virtual void OnProcessLaunched() OVERRIDE; |
153 | 153 |
154 // Creates and adds the message filters. | 154 // Creates and adds the message filters. |
155 void CreateMessageFilters(int render_process_id); | 155 void CreateMessageFilters(int render_process_id); |
156 | 156 |
157 // IPC::Channel::Listener implementation: | 157 // IPC::Channel::Listener implementation: |
158 // Called when a message arrives from the worker process. | 158 // Called when a message arrives from the worker process. |
159 virtual bool OnMessageReceived(const IPC::Message& message); | 159 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
160 | 160 |
161 void OnWorkerContextClosed(int worker_route_id); | 161 void OnWorkerContextClosed(int worker_route_id); |
162 void OnAllowDatabase(int worker_route_id, | 162 void OnAllowDatabase(int worker_route_id, |
163 const GURL& url, | 163 const GURL& url, |
164 const string16& name, | 164 const string16& name, |
165 const string16& display_name, | 165 const string16& display_name, |
166 unsigned long estimated_size, | 166 unsigned long estimated_size, |
167 bool* result); | 167 bool* result); |
168 void OnAllowFileSystem(int worker_route_id, | 168 void OnAllowFileSystem(int worker_route_id, |
169 const GURL& url, | 169 const GURL& url, |
170 bool* result); | 170 bool* result); |
171 | 171 |
172 // Relays a message to the given endpoint. Takes care of parsing the message | 172 // Relays a message to the given endpoint. Takes care of parsing the message |
173 // if it contains a message port and sending it a valid route id. | 173 // if it contains a message port and sending it a valid route id. |
174 void RelayMessage(const IPC::Message& message, | 174 void RelayMessage(const IPC::Message& message, |
175 WorkerMessageFilter* filter, | 175 WorkerMessageFilter* filter, |
176 int route_id); | 176 int route_id); |
177 | 177 |
178 virtual bool CanShutdown(); | 178 virtual bool CanShutdown() OVERRIDE; |
179 | 179 |
180 // Updates the title shown in the task manager. | 180 // Updates the title shown in the task manager. |
181 void UpdateTitle(); | 181 void UpdateTitle(); |
182 | 182 |
183 Instances instances_; | 183 Instances instances_; |
184 | 184 |
185 const content::ResourceContext* const resource_context_; | 185 const content::ResourceContext* const resource_context_; |
186 | 186 |
187 // A reference to the filter associated with this worker process. We need to | 187 // A reference to the filter associated with this worker process. We need to |
188 // keep this around since we'll use it when forward messages to the worker | 188 // keep this around since we'll use it when forward messages to the worker |
189 // process. | 189 // process. |
190 scoped_refptr<WorkerMessageFilter> worker_message_filter_; | 190 scoped_refptr<WorkerMessageFilter> worker_message_filter_; |
191 | 191 |
192 ResourceDispatcherHost* const resource_dispatcher_host_; | 192 ResourceDispatcherHost* const resource_dispatcher_host_; |
193 | 193 |
194 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); | 194 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); |
195 }; | 195 }; |
196 | 196 |
197 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 197 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
OLD | NEW |