| 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 22 matching lines...) Expand all Loading... |
| 33 #include "base/timer/elapsed_timer.h" | 33 #include "base/timer/elapsed_timer.h" |
| 34 #include "base/trace_event/memory_dump_manager.h" | 34 #include "base/trace_event/memory_dump_manager.h" |
| 35 #include "base/tracked_objects.h" | 35 #include "base/tracked_objects.h" |
| 36 #include "build/build_config.h" | 36 #include "build/build_config.h" |
| 37 #include "components/tracing/child/child_trace_message_filter.h" | 37 #include "components/tracing/child/child_trace_message_filter.h" |
| 38 #include "content/child/child_histogram_message_filter.h" | 38 #include "content/child/child_histogram_message_filter.h" |
| 39 #include "content/child/child_process.h" | 39 #include "content/child/child_process.h" |
| 40 #include "content/child/child_resource_message_filter.h" | 40 #include "content/child/child_resource_message_filter.h" |
| 41 #include "content/child/fileapi/file_system_dispatcher.h" | 41 #include "content/child/fileapi/file_system_dispatcher.h" |
| 42 #include "content/child/fileapi/webfilesystem_impl.h" | 42 #include "content/child/fileapi/webfilesystem_impl.h" |
| 43 #include "content/child/memory/child_memory_message_filter.h" | |
| 44 #include "content/child/notifications/notification_dispatcher.h" | 43 #include "content/child/notifications/notification_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" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 channel_->AddFilter(resource_message_filter_.get()); | 487 channel_->AddFilter(resource_message_filter_.get()); |
| 489 channel_->AddFilter(quota_message_filter_->GetFilter()); | 488 channel_->AddFilter(quota_message_filter_->GetFilter()); |
| 490 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 489 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
| 491 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 490 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
| 492 | 491 |
| 493 if (!IsInBrowserProcess()) { | 492 if (!IsInBrowserProcess()) { |
| 494 // In single process mode, browser-side tracing and memory will cover the | 493 // In single process mode, browser-side tracing and memory will cover the |
| 495 // whole process including renderers. | 494 // whole process including renderers. |
| 496 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 495 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
| 497 ChildProcess::current()->io_task_runner())); | 496 ChildProcess::current()->io_task_runner())); |
| 498 channel_->AddFilter(new ChildMemoryMessageFilter()); | |
| 499 | 497 |
| 500 if (service_manager_connection_) { | 498 if (service_manager_connection_) { |
| 501 memory_instrumentation::ProcessLocalDumpManagerImpl::Config config( | 499 memory_instrumentation::ProcessLocalDumpManagerImpl::Config config( |
| 502 GetConnector(), mojom::kBrowserServiceName); | 500 GetConnector(), mojom::kBrowserServiceName); |
| 503 memory_instrumentation::ProcessLocalDumpManagerImpl::CreateInstance( | 501 memory_instrumentation::ProcessLocalDumpManagerImpl::CreateInstance( |
| 504 config); | 502 config); |
| 505 } | 503 } |
| 506 } | 504 } |
| 507 | 505 |
| 508 // In single process mode we may already have a power monitor, | 506 // In single process mode we may already have a power monitor, |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 Listener* route = router_.GetRoute(routing_id); | 829 Listener* route = router_.GetRoute(routing_id); |
| 832 if (route) | 830 if (route) |
| 833 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); | 831 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); |
| 834 } | 832 } |
| 835 | 833 |
| 836 bool ChildThreadImpl::IsInBrowserProcess() const { | 834 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 837 return static_cast<bool>(browser_process_io_runner_); | 835 return static_cast<bool>(browser_process_io_runner_); |
| 838 } | 836 } |
| 839 | 837 |
| 840 } // namespace content | 838 } // namespace content |
| OLD | NEW |