| 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 #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/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "content/browser/appcache/appcache_dispatcher_host.h" | 15 #include "content/browser/appcache/appcache_dispatcher_host.h" |
| 16 #include "content/browser/browser_thread.h" | 16 #include "content/browser/browser_thread.h" |
| 17 #include "content/browser/child_process_security_policy.h" | 17 #include "content/browser/child_process_security_policy.h" |
| 18 #include "content/browser/content_browser_client.h" | 18 #include "content/browser/content_browser_client.h" |
| 19 #include "content/browser/debugger/worker_devtools_message_filter.h" |
| 19 #include "content/browser/file_system/file_system_dispatcher_host.h" | 20 #include "content/browser/file_system/file_system_dispatcher_host.h" |
| 20 #include "content/browser/mime_registry_message_filter.h" | 21 #include "content/browser/mime_registry_message_filter.h" |
| 21 #include "content/browser/renderer_host/blob_message_filter.h" | 22 #include "content/browser/renderer_host/blob_message_filter.h" |
| 22 #include "content/browser/renderer_host/database_message_filter.h" | 23 #include "content/browser/renderer_host/database_message_filter.h" |
| 23 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 24 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
| 24 #include "content/browser/renderer_host/render_view_host.h" | 25 #include "content/browser/renderer_host/render_view_host.h" |
| 25 #include "content/browser/renderer_host/render_view_host_delegate.h" | 26 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 26 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 27 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
| 27 #include "content/browser/resource_context.h" | 28 #include "content/browser/resource_context.h" |
| 28 #include "content/browser/user_metrics.h" | 29 #include "content/browser/user_metrics.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 AddFilter( | 249 AddFilter( |
| 249 new BlobMessageFilter(id(), resource_context_->blob_storage_context())); | 250 new BlobMessageFilter(id(), resource_context_->blob_storage_context())); |
| 250 AddFilter(new MimeRegistryMessageFilter()); | 251 AddFilter(new MimeRegistryMessageFilter()); |
| 251 AddFilter(new DatabaseMessageFilter( | 252 AddFilter(new DatabaseMessageFilter( |
| 252 resource_context_->database_tracker())); | 253 resource_context_->database_tracker())); |
| 253 | 254 |
| 254 SocketStreamDispatcherHost* socket_stream_dispatcher_host = | 255 SocketStreamDispatcherHost* socket_stream_dispatcher_host = |
| 255 new SocketStreamDispatcherHost( | 256 new SocketStreamDispatcherHost( |
| 256 new URLRequestContextSelector(request_context), resource_context_); | 257 new URLRequestContextSelector(request_context), resource_context_); |
| 257 AddFilter(socket_stream_dispatcher_host); | 258 AddFilter(socket_stream_dispatcher_host); |
| 259 AddFilter(new WorkerDevToolsMessageFilter(id())); |
| 258 } | 260 } |
| 259 | 261 |
| 260 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { | 262 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { |
| 261 ChildProcessSecurityPolicy::GetInstance()->GrantRequestURL( | 263 ChildProcessSecurityPolicy::GetInstance()->GrantRequestURL( |
| 262 id(), instance.url()); | 264 id(), instance.url()); |
| 263 | 265 |
| 264 instances_.push_back(instance); | 266 instances_.push_back(instance); |
| 265 | 267 |
| 266 WorkerProcessMsg_CreateWorker_Params params; | 268 WorkerProcessMsg_CreateWorker_Params params; |
| 267 params.url = instance.url(); | 269 params.url = instance.url(); |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 } | 631 } |
| 630 } | 632 } |
| 631 return false; | 633 return false; |
| 632 } | 634 } |
| 633 | 635 |
| 634 WorkerProcessHost::WorkerInstance::FilterInfo | 636 WorkerProcessHost::WorkerInstance::FilterInfo |
| 635 WorkerProcessHost::WorkerInstance::GetFilter() const { | 637 WorkerProcessHost::WorkerInstance::GetFilter() const { |
| 636 DCHECK(NumFilters() == 1); | 638 DCHECK(NumFilters() == 1); |
| 637 return *filters_.begin(); | 639 return *filters_.begin(); |
| 638 } | 640 } |
| OLD | NEW |