OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/worker_host/worker_process_host.h" | 5 #include "content/browser/worker_host/worker_process_host.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 get_contexts_callback); | 223 get_contexts_callback); |
224 process_->GetHost()->AddFilter(resource_message_filter); | 224 process_->GetHost()->AddFilter(resource_message_filter); |
225 | 225 |
226 worker_message_filter_ = new WorkerMessageFilter( | 226 worker_message_filter_ = new WorkerMessageFilter( |
227 render_process_id, resource_context_, partition_, | 227 render_process_id, resource_context_, partition_, |
228 base::Bind(&WorkerServiceImpl::next_worker_route_id, | 228 base::Bind(&WorkerServiceImpl::next_worker_route_id, |
229 base::Unretained(WorkerServiceImpl::GetInstance()))); | 229 base::Unretained(WorkerServiceImpl::GetInstance()))); |
230 process_->GetHost()->AddFilter(worker_message_filter_.get()); | 230 process_->GetHost()->AddFilter(worker_message_filter_.get()); |
231 process_->GetHost()->AddFilter(new AppCacheDispatcherHost( | 231 process_->GetHost()->AddFilter(new AppCacheDispatcherHost( |
232 partition_.appcache_service(), process_->GetData().id)); | 232 partition_.appcache_service(), process_->GetData().id)); |
233 process_->GetHost()->AddFilter(new FileAPIMessageFilter( | |
234 process_->GetData().id, | |
235 url_request_context, | |
236 partition_.filesystem_context(), | |
237 blob_storage_context, | |
238 stream_context)); | |
239 process_->GetHost()->AddFilter(new FileUtilitiesMessageFilter( | 233 process_->GetHost()->AddFilter(new FileUtilitiesMessageFilter( |
240 process_->GetData().id)); | 234 process_->GetData().id)); |
241 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); | 235 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); |
242 process_->GetHost()->AddFilter( | 236 process_->GetHost()->AddFilter( |
243 new DatabaseMessageFilter(partition_.database_tracker())); | 237 new DatabaseMessageFilter(partition_.database_tracker())); |
244 process_->GetHost()->AddFilter(new QuotaDispatcherHost( | 238 process_->GetHost()->AddFilter(new QuotaDispatcherHost( |
245 process_->GetData().id, | 239 process_->GetData().id, |
246 partition_.quota_manager(), | 240 partition_.quota_manager(), |
247 GetContentClient()->browser()->CreateQuotaPermissionContext())); | 241 GetContentClient()->browser()->CreateQuotaPermissionContext())); |
248 | 242 |
249 SocketStreamDispatcherHost::GetRequestContextCallback | 243 SocketStreamDispatcherHost::GetRequestContextCallback |
250 request_context_callback( | 244 request_context_callback( |
251 base::Bind(&WorkerProcessHost::GetRequestContext, | 245 base::Bind(&WorkerProcessHost::GetRequestContext, |
252 base::Unretained(this))); | 246 base::Unretained(this))); |
253 | 247 |
254 SocketStreamDispatcherHost* socket_stream_dispatcher_host = | 248 SocketStreamDispatcherHost* socket_stream_dispatcher_host = |
255 new SocketStreamDispatcherHost( | 249 new SocketStreamDispatcherHost( |
256 render_process_id, | 250 render_process_id, |
257 request_context_callback, | 251 request_context_callback, |
258 resource_context_); | 252 resource_context_); |
259 socket_stream_dispatcher_host_ = socket_stream_dispatcher_host; | 253 socket_stream_dispatcher_host_ = socket_stream_dispatcher_host; |
260 process_->GetHost()->AddFilter(socket_stream_dispatcher_host); | 254 process_->GetHost()->AddFilter(socket_stream_dispatcher_host); |
261 process_->GetHost()->AddFilter( | 255 process_->GetHost()->AddFilter( |
262 new WorkerDevToolsMessageFilter(process_->GetData().id)); | 256 new WorkerDevToolsMessageFilter(process_->GetData().id)); |
263 process_->GetHost()->AddFilter(new IndexedDBDispatcherHost( | 257 { |
264 process_->GetData().id, partition_.indexed_db_context())); | 258 FileAPIMessageFilter* file_api_message_filter = new FileAPIMessageFilter( |
| 259 process_->GetData().id, |
| 260 url_request_context, |
| 261 partition_.filesystem_context(), |
| 262 blob_storage_context, |
| 263 stream_context); |
| 264 process_->GetHost()->AddFilter(file_api_message_filter); |
| 265 process_->GetHost()->AddFilter(new IndexedDBDispatcherHost( |
| 266 process_->GetData().id, url_request_context, |
| 267 partition_.indexed_db_context(), |
| 268 file_api_message_filter)); |
| 269 } |
265 } | 270 } |
266 | 271 |
267 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { | 272 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { |
268 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | 273 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
269 process_->GetData().id, instance.url()); | 274 process_->GetData().id, instance.url()); |
270 | 275 |
271 instances_.push_back(instance); | 276 instances_.push_back(instance); |
272 | 277 |
273 WorkerProcessMsg_CreateWorker_Params params; | 278 WorkerProcessMsg_CreateWorker_Params params; |
274 params.url = instance.url(); | 279 params.url = instance.url(); |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 return false; | 716 return false; |
712 } | 717 } |
713 | 718 |
714 WorkerProcessHost::WorkerInstance::FilterInfo | 719 WorkerProcessHost::WorkerInstance::FilterInfo |
715 WorkerProcessHost::WorkerInstance::GetFilter() const { | 720 WorkerProcessHost::WorkerInstance::GetFilter() const { |
716 DCHECK(NumFilters() == 1); | 721 DCHECK(NumFilters() == 1); |
717 return *filters_.begin(); | 722 return *filters_.begin(); |
718 } | 723 } |
719 | 724 |
720 } // namespace content | 725 } // namespace content |
OLD | NEW |