| 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/child/child_thread_impl.h" | 5 #include "content/child/child_thread_impl.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "base/tracked_objects.h" | 34 #include "base/tracked_objects.h" |
| 35 #include "build/build_config.h" | 35 #include "build/build_config.h" |
| 36 #include "components/tracing/child/child_trace_message_filter.h" | 36 #include "components/tracing/child/child_trace_message_filter.h" |
| 37 #include "content/child/child_histogram_message_filter.h" | 37 #include "content/child/child_histogram_message_filter.h" |
| 38 #include "content/child/child_process.h" | 38 #include "content/child/child_process.h" |
| 39 #include "content/child/child_resource_message_filter.h" | 39 #include "content/child/child_resource_message_filter.h" |
| 40 #include "content/child/fileapi/file_system_dispatcher.h" | 40 #include "content/child/fileapi/file_system_dispatcher.h" |
| 41 #include "content/child/fileapi/webfilesystem_impl.h" | 41 #include "content/child/fileapi/webfilesystem_impl.h" |
| 42 #include "content/child/memory/child_memory_message_filter.h" | 42 #include "content/child/memory/child_memory_message_filter.h" |
| 43 #include "content/child/notifications/notification_dispatcher.h" | 43 #include "content/child/notifications/notification_dispatcher.h" |
| 44 #include "content/child/push_messaging/push_dispatcher.h" | |
| 45 #include "content/child/quota_dispatcher.h" | 44 #include "content/child/quota_dispatcher.h" |
| 46 #include "content/child/quota_message_filter.h" | 45 #include "content/child/quota_message_filter.h" |
| 47 #include "content/child/resource_dispatcher.h" | 46 #include "content/child/resource_dispatcher.h" |
| 48 #include "content/child/service_worker/service_worker_message_filter.h" | 47 #include "content/child/service_worker/service_worker_message_filter.h" |
| 49 #include "content/child/thread_safe_sender.h" | 48 #include "content/child/thread_safe_sender.h" |
| 50 #include "content/common/child_process_messages.h" | 49 #include "content/common/child_process_messages.h" |
| 51 #include "content/common/in_process_child_thread_params.h" | 50 #include "content/common/in_process_child_thread_params.h" |
| 52 #include "content/public/common/connection_filter.h" | 51 #include "content/public/common/connection_filter.h" |
| 53 #include "content/public/common/content_switches.h" | 52 #include "content/public/common/content_switches.h" |
| 54 #include "content/public/common/mojo_channel_switches.h" | 53 #include "content/public/common/mojo_channel_switches.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 482 |
| 484 service_worker_message_filter_ = | 483 service_worker_message_filter_ = |
| 485 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); | 484 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); |
| 486 | 485 |
| 487 quota_message_filter_ = | 486 quota_message_filter_ = |
| 488 new QuotaMessageFilter(thread_safe_sender_.get()); | 487 new QuotaMessageFilter(thread_safe_sender_.get()); |
| 489 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), | 488 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), |
| 490 quota_message_filter_.get())); | 489 quota_message_filter_.get())); |
| 491 notification_dispatcher_ = | 490 notification_dispatcher_ = |
| 492 new NotificationDispatcher(thread_safe_sender_.get()); | 491 new NotificationDispatcher(thread_safe_sender_.get()); |
| 493 push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); | |
| 494 | 492 |
| 495 channel_->AddFilter(histogram_message_filter_.get()); | 493 channel_->AddFilter(histogram_message_filter_.get()); |
| 496 channel_->AddFilter(resource_message_filter_.get()); | 494 channel_->AddFilter(resource_message_filter_.get()); |
| 497 channel_->AddFilter(quota_message_filter_->GetFilter()); | 495 channel_->AddFilter(quota_message_filter_->GetFilter()); |
| 498 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 496 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
| 499 channel_->AddFilter(push_dispatcher_->GetFilter()); | |
| 500 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 497 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
| 501 | 498 |
| 502 if (!IsInBrowserProcess()) { | 499 if (!IsInBrowserProcess()) { |
| 503 // In single process mode, browser-side tracing and memory will cover the | 500 // In single process mode, browser-side tracing and memory will cover the |
| 504 // whole process including renderers. | 501 // whole process including renderers. |
| 505 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 502 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
| 506 ChildProcess::current()->io_task_runner())); | 503 ChildProcess::current()->io_task_runner())); |
| 507 channel_->AddFilter(new ChildMemoryMessageFilter()); | 504 channel_->AddFilter(new ChildMemoryMessageFilter()); |
| 508 } | 505 } |
| 509 | 506 |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 connected_to_browser_ = true; | 871 connected_to_browser_ = true; |
| 875 child_info_ = local_info; | 872 child_info_ = local_info; |
| 876 browser_info_ = remote_info; | 873 browser_info_ = remote_info; |
| 877 } | 874 } |
| 878 | 875 |
| 879 bool ChildThreadImpl::IsInBrowserProcess() const { | 876 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 880 return static_cast<bool>(browser_process_io_runner_); | 877 return static_cast<bool>(browser_process_io_runner_); |
| 881 } | 878 } |
| 882 | 879 |
| 883 } // namespace content | 880 } // namespace content |
| OLD | NEW |