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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 blob_storage_context, | 240 blob_storage_context, |
241 partition_.filesystem_context(), | 241 partition_.filesystem_context(), |
242 new URLRequestContextSelector(url_request_context, | 242 new URLRequestContextSelector(url_request_context, |
243 media_url_request_context)); | 243 media_url_request_context)); |
244 process_->GetHost()->AddFilter(resource_message_filter); | 244 process_->GetHost()->AddFilter(resource_message_filter); |
245 | 245 |
246 worker_message_filter_ = new WorkerMessageFilter( | 246 worker_message_filter_ = new WorkerMessageFilter( |
247 render_process_id, resource_context_, partition_, | 247 render_process_id, resource_context_, partition_, |
248 base::Bind(&WorkerServiceImpl::next_worker_route_id, | 248 base::Bind(&WorkerServiceImpl::next_worker_route_id, |
249 base::Unretained(WorkerServiceImpl::GetInstance()))); | 249 base::Unretained(WorkerServiceImpl::GetInstance()))); |
250 process_->GetHost()->AddFilter(worker_message_filter_); | 250 process_->GetHost()->AddFilter(worker_message_filter_.get()); |
251 process_->GetHost()->AddFilter(new AppCacheDispatcherHost( | 251 process_->GetHost()->AddFilter(new AppCacheDispatcherHost( |
252 partition_.appcache_service(), | 252 partition_.appcache_service(), process_->GetData().id)); |
253 process_->GetData().id)); | |
254 process_->GetHost()->AddFilter(new FileAPIMessageFilter( | 253 process_->GetHost()->AddFilter(new FileAPIMessageFilter( |
255 process_->GetData().id, | 254 process_->GetData().id, |
256 url_request_context, | 255 url_request_context, |
257 partition_.filesystem_context(), | 256 partition_.filesystem_context(), |
258 blob_storage_context)); | 257 blob_storage_context)); |
259 process_->GetHost()->AddFilter(new FileUtilitiesMessageFilter( | 258 process_->GetHost()->AddFilter(new FileUtilitiesMessageFilter( |
260 process_->GetData().id)); | 259 process_->GetData().id)); |
261 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); | 260 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); |
262 process_->GetHost()->AddFilter( | 261 process_->GetHost()->AddFilter( |
263 new DatabaseMessageFilter(partition_.database_tracker())); | 262 new DatabaseMessageFilter(partition_.database_tracker())); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 i != instance.filters().end(); ++i) { | 302 i != instance.filters().end(); ++i) { |
304 CHECK(i->first); | 303 CHECK(i->first); |
305 i->first->Send(new ViewMsg_WorkerCreated(i->second)); | 304 i->first->Send(new ViewMsg_WorkerCreated(i->second)); |
306 } | 305 } |
307 } | 306 } |
308 | 307 |
309 bool WorkerProcessHost::FilterMessage(const IPC::Message& message, | 308 bool WorkerProcessHost::FilterMessage(const IPC::Message& message, |
310 WorkerMessageFilter* filter) { | 309 WorkerMessageFilter* filter) { |
311 for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) { | 310 for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) { |
312 if (!i->closed() && i->HasFilter(filter, message.routing_id())) { | 311 if (!i->closed() && i->HasFilter(filter, message.routing_id())) { |
313 RelayMessage(message, worker_message_filter_, i->worker_route_id()); | 312 RelayMessage(message, worker_message_filter_.get(), i->worker_route_id()); |
314 return true; | 313 return true; |
315 } | 314 } |
316 } | 315 } |
317 | 316 |
318 return false; | 317 return false; |
319 } | 318 } |
320 | 319 |
321 void WorkerProcessHost::OnProcessLaunched() { | 320 void WorkerProcessHost::OnProcessLaunched() { |
322 process_launched_ = true; | 321 process_launched_ = true; |
323 | 322 |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 return false; | 698 return false; |
700 } | 699 } |
701 | 700 |
702 WorkerProcessHost::WorkerInstance::FilterInfo | 701 WorkerProcessHost::WorkerInstance::FilterInfo |
703 WorkerProcessHost::WorkerInstance::GetFilter() const { | 702 WorkerProcessHost::WorkerInstance::GetFilter() const { |
704 DCHECK(NumFilters() == 1); | 703 DCHECK(NumFilters() == 1); |
705 return *filters_.begin(); | 704 return *filters_.begin(); |
706 } | 705 } |
707 | 706 |
708 } // namespace content | 707 } // namespace content |
OLD | NEW |