| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "content/browser/appcache/appcache_dispatcher_host.h" | 18 #include "content/browser/appcache/appcache_dispatcher_host.h" |
| 19 #include "content/browser/browser_child_process_host_impl.h" | 19 #include "content/browser/browser_child_process_host_impl.h" |
| 20 #include "content/browser/child_process_security_policy_impl.h" | 20 #include "content/browser/child_process_security_policy_impl.h" |
| 21 #include "content/browser/debugger/worker_devtools_manager.h" | 21 #include "content/browser/debugger/worker_devtools_manager.h" |
| 22 #include "content/browser/debugger/worker_devtools_message_filter.h" | 22 #include "content/browser/debugger/worker_devtools_message_filter.h" |
| 23 #include "content/browser/file_system/file_system_dispatcher_host.h" | 23 #include "content/browser/file_system/file_system_dispatcher_host.h" |
| 24 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
| 24 #include "content/browser/mime_registry_message_filter.h" | 25 #include "content/browser/mime_registry_message_filter.h" |
| 25 #include "content/browser/renderer_host/blob_message_filter.h" | 26 #include "content/browser/renderer_host/blob_message_filter.h" |
| 26 #include "content/browser/renderer_host/database_message_filter.h" | 27 #include "content/browser/renderer_host/database_message_filter.h" |
| 27 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 28 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
| 28 #include "content/browser/renderer_host/render_view_host.h" | 29 #include "content/browser/renderer_host/render_view_host.h" |
| 29 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 30 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
| 30 #include "content/browser/resource_context.h" | 31 #include "content/browser/resource_context.h" |
| 31 #include "content/browser/worker_host/message_port_service.h" | 32 #include "content/browser/worker_host/message_port_service.h" |
| 32 #include "content/browser/worker_host/worker_message_filter.h" | 33 #include "content/browser/worker_host/worker_message_filter.h" |
| 33 #include "content/browser/worker_host/worker_service_impl.h" | 34 #include "content/browser/worker_host/worker_service_impl.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); | 267 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); |
| 267 process_->GetHost()->AddFilter(new DatabaseMessageFilter( | 268 process_->GetHost()->AddFilter(new DatabaseMessageFilter( |
| 268 resource_context_->database_tracker())); | 269 resource_context_->database_tracker())); |
| 269 | 270 |
| 270 SocketStreamDispatcherHost* socket_stream_dispatcher_host = | 271 SocketStreamDispatcherHost* socket_stream_dispatcher_host = |
| 271 new SocketStreamDispatcherHost( | 272 new SocketStreamDispatcherHost( |
| 272 new URLRequestContextSelector(request_context), resource_context_); | 273 new URLRequestContextSelector(request_context), resource_context_); |
| 273 process_->GetHost()->AddFilter(socket_stream_dispatcher_host); | 274 process_->GetHost()->AddFilter(socket_stream_dispatcher_host); |
| 274 process_->GetHost()->AddFilter( | 275 process_->GetHost()->AddFilter( |
| 275 new content::WorkerDevToolsMessageFilter(process_->GetData().id)); | 276 new content::WorkerDevToolsMessageFilter(process_->GetData().id)); |
| 277 process_->GetHost()->AddFilter(new IndexedDBDispatcherHost( |
| 278 process_->GetData().id, resource_context_->webkit_context())); |
| 276 } | 279 } |
| 277 | 280 |
| 278 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { | 281 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { |
| 279 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | 282 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
| 280 process_->GetData().id, instance.url()); | 283 process_->GetData().id, instance.url()); |
| 281 | 284 |
| 282 instances_.push_back(instance); | 285 instances_.push_back(instance); |
| 283 | 286 |
| 284 WorkerProcessMsg_CreateWorker_Params params; | 287 WorkerProcessMsg_CreateWorker_Params params; |
| 285 params.url = instance.url(); | 288 params.url = instance.url(); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 } | 668 } |
| 666 } | 669 } |
| 667 return false; | 670 return false; |
| 668 } | 671 } |
| 669 | 672 |
| 670 WorkerProcessHost::WorkerInstance::FilterInfo | 673 WorkerProcessHost::WorkerInstance::FilterInfo |
| 671 WorkerProcessHost::WorkerInstance::GetFilter() const { | 674 WorkerProcessHost::WorkerInstance::GetFilter() const { |
| 672 DCHECK(NumFilters() == 1); | 675 DCHECK(NumFilters() == 1); |
| 673 return *filters_.begin(); | 676 return *filters_.begin(); |
| 674 } | 677 } |
| OLD | NEW |