| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 ResourceMessageFilter::GetContextsCallback get_contexts_callback( | 214 ResourceMessageFilter::GetContextsCallback get_contexts_callback( |
| 215 base::Bind(&WorkerProcessHost::GetContexts, | 215 base::Bind(&WorkerProcessHost::GetContexts, |
| 216 base::Unretained(this))); | 216 base::Unretained(this))); |
| 217 | 217 |
| 218 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 218 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |
| 219 process_->GetData().id, PROCESS_TYPE_WORKER, | 219 process_->GetData().id, PROCESS_TYPE_WORKER, |
| 220 partition_.appcache_service(), | 220 partition_.appcache_service(), |
| 221 blob_storage_context, | 221 blob_storage_context, |
| 222 partition_.filesystem_context(), | 222 partition_.filesystem_context(), |
| 223 get_contexts_callback); | 223 get_contexts_callback); |
| 224 process_->GetHost()->AddFilter(resource_message_filter); | 224 process_->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_->AddFilter(worker_message_filter_.get()); |
| 231 process_->GetHost()->AddFilter(new AppCacheDispatcherHost( | 231 process_->AddFilter(new AppCacheDispatcherHost( |
| 232 partition_.appcache_service(), process_->GetData().id)); | 232 partition_.appcache_service(), process_->GetData().id)); |
| 233 process_->GetHost()->AddFilter(new FileAPIMessageFilter( | 233 process_->AddFilter(new FileAPIMessageFilter( |
| 234 process_->GetData().id, | 234 process_->GetData().id, |
| 235 url_request_context, | 235 url_request_context, |
| 236 partition_.filesystem_context(), | 236 partition_.filesystem_context(), |
| 237 blob_storage_context, | 237 blob_storage_context, |
| 238 stream_context)); | 238 stream_context)); |
| 239 process_->GetHost()->AddFilter(new FileUtilitiesMessageFilter( | 239 process_->AddFilter(new FileUtilitiesMessageFilter( |
| 240 process_->GetData().id)); | 240 process_->GetData().id)); |
| 241 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); | 241 process_->AddFilter(new MimeRegistryMessageFilter()); |
| 242 process_->GetHost()->AddFilter( | 242 process_->AddFilter(new DatabaseMessageFilter(partition_.database_tracker())); |
| 243 new DatabaseMessageFilter(partition_.database_tracker())); | 243 process_->AddFilter(new QuotaDispatcherHost( |
| 244 process_->GetHost()->AddFilter(new QuotaDispatcherHost( | |
| 245 process_->GetData().id, | 244 process_->GetData().id, |
| 246 partition_.quota_manager(), | 245 partition_.quota_manager(), |
| 247 GetContentClient()->browser()->CreateQuotaPermissionContext())); | 246 GetContentClient()->browser()->CreateQuotaPermissionContext())); |
| 248 | 247 |
| 249 SocketStreamDispatcherHost::GetRequestContextCallback | 248 SocketStreamDispatcherHost::GetRequestContextCallback |
| 250 request_context_callback( | 249 request_context_callback( |
| 251 base::Bind(&WorkerProcessHost::GetRequestContext, | 250 base::Bind(&WorkerProcessHost::GetRequestContext, |
| 252 base::Unretained(this))); | 251 base::Unretained(this))); |
| 253 | 252 |
| 254 SocketStreamDispatcherHost* socket_stream_dispatcher_host = | 253 SocketStreamDispatcherHost* socket_stream_dispatcher_host = |
| 255 new SocketStreamDispatcherHost( | 254 new SocketStreamDispatcherHost( |
| 256 render_process_id, | 255 render_process_id, |
| 257 request_context_callback, | 256 request_context_callback, |
| 258 resource_context_); | 257 resource_context_); |
| 259 socket_stream_dispatcher_host_ = socket_stream_dispatcher_host; | 258 socket_stream_dispatcher_host_ = socket_stream_dispatcher_host; |
| 260 process_->GetHost()->AddFilter(socket_stream_dispatcher_host); | 259 process_->AddFilter(socket_stream_dispatcher_host); |
| 261 process_->GetHost()->AddFilter( | 260 process_->AddFilter(new WorkerDevToolsMessageFilter(process_->GetData().id)); |
| 262 new WorkerDevToolsMessageFilter(process_->GetData().id)); | 261 process_->AddFilter(new IndexedDBDispatcherHost( |
| 263 process_->GetHost()->AddFilter(new IndexedDBDispatcherHost( | |
| 264 process_->GetData().id, partition_.indexed_db_context())); | 262 process_->GetData().id, partition_.indexed_db_context())); |
| 265 } | 263 } |
| 266 | 264 |
| 267 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { | 265 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { |
| 268 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | 266 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
| 269 process_->GetData().id, instance.url()); | 267 process_->GetData().id, instance.url()); |
| 270 | 268 |
| 271 instances_.push_back(instance); | 269 instances_.push_back(instance); |
| 272 | 270 |
| 273 WorkerProcessMsg_CreateWorker_Params params; | 271 WorkerProcessMsg_CreateWorker_Params params; |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 return false; | 709 return false; |
| 712 } | 710 } |
| 713 | 711 |
| 714 WorkerProcessHost::WorkerInstance::FilterInfo | 712 WorkerProcessHost::WorkerInstance::FilterInfo |
| 715 WorkerProcessHost::WorkerInstance::GetFilter() const { | 713 WorkerProcessHost::WorkerInstance::GetFilter() const { |
| 716 DCHECK(NumFilters() == 1); | 714 DCHECK(NumFilters() == 1); |
| 717 return *filters_.begin(); | 715 return *filters_.begin(); |
| 718 } | 716 } |
| 719 | 717 |
| 720 } // namespace content | 718 } // namespace content |
| OLD | NEW |