| 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 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "components/tracing/child_trace_message_filter.h" | 32 #include "components/tracing/child_trace_message_filter.h" |
| 33 #include "content/child/child_discardable_shared_memory_manager.h" | 33 #include "content/child/child_discardable_shared_memory_manager.h" |
| 34 #include "content/child/child_gpu_memory_buffer_manager.h" | 34 #include "content/child/child_gpu_memory_buffer_manager.h" |
| 35 #include "content/child/child_histogram_message_filter.h" | 35 #include "content/child/child_histogram_message_filter.h" |
| 36 #include "content/child/child_process.h" | 36 #include "content/child/child_process.h" |
| 37 #include "content/child/child_resource_message_filter.h" | 37 #include "content/child/child_resource_message_filter.h" |
| 38 #include "content/child/child_shared_bitmap_manager.h" | 38 #include "content/child/child_shared_bitmap_manager.h" |
| 39 #include "content/child/fileapi/file_system_dispatcher.h" | 39 #include "content/child/fileapi/file_system_dispatcher.h" |
| 40 #include "content/child/fileapi/webfilesystem_impl.h" | 40 #include "content/child/fileapi/webfilesystem_impl.h" |
| 41 #include "content/child/geofencing/geofencing_message_filter.h" | 41 #include "content/child/geofencing/geofencing_message_filter.h" |
| 42 #include "content/child/memory/child_memory_message_filter.h" |
| 42 #include "content/child/mojo/mojo_application.h" | 43 #include "content/child/mojo/mojo_application.h" |
| 43 #include "content/child/notifications/notification_dispatcher.h" | 44 #include "content/child/notifications/notification_dispatcher.h" |
| 44 #include "content/child/power_monitor_broadcast_source.h" | 45 #include "content/child/power_monitor_broadcast_source.h" |
| 45 #include "content/child/push_messaging/push_dispatcher.h" | 46 #include "content/child/push_messaging/push_dispatcher.h" |
| 46 #include "content/child/quota_dispatcher.h" | 47 #include "content/child/quota_dispatcher.h" |
| 47 #include "content/child/quota_message_filter.h" | 48 #include "content/child/quota_message_filter.h" |
| 48 #include "content/child/resource_dispatcher.h" | 49 #include "content/child/resource_dispatcher.h" |
| 49 #include "content/child/service_worker/service_worker_message_filter.h" | 50 #include "content/child/service_worker/service_worker_message_filter.h" |
| 50 #include "content/child/thread_safe_sender.h" | 51 #include "content/child/thread_safe_sender.h" |
| 51 #include "content/child/websocket_dispatcher.h" | 52 #include "content/child/websocket_dispatcher.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 423 |
| 423 channel_->AddFilter(histogram_message_filter_.get()); | 424 channel_->AddFilter(histogram_message_filter_.get()); |
| 424 channel_->AddFilter(resource_message_filter_.get()); | 425 channel_->AddFilter(resource_message_filter_.get()); |
| 425 channel_->AddFilter(quota_message_filter_->GetFilter()); | 426 channel_->AddFilter(quota_message_filter_->GetFilter()); |
| 426 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 427 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
| 427 channel_->AddFilter(push_dispatcher_->GetFilter()); | 428 channel_->AddFilter(push_dispatcher_->GetFilter()); |
| 428 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 429 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
| 429 channel_->AddFilter(geofencing_message_filter_->GetFilter()); | 430 channel_->AddFilter(geofencing_message_filter_->GetFilter()); |
| 430 | 431 |
| 431 if (!IsInBrowserProcess()) { | 432 if (!IsInBrowserProcess()) { |
| 432 // In single process mode, browser-side tracing will cover the whole | 433 // In single process mode, browser-side tracing and memory will cover the |
| 433 // process including renderers. | 434 // whole process including renderers. |
| 434 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 435 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
| 435 ChildProcess::current()->io_task_runner())); | 436 ChildProcess::current()->io_task_runner())); |
| 437 channel_->AddFilter(new memory::ChildMemoryMessageFilter()); |
| 436 } | 438 } |
| 437 | 439 |
| 438 // In single process mode we may already have a power monitor | 440 // In single process mode we may already have a power monitor |
| 439 if (!base::PowerMonitor::Get()) { | 441 if (!base::PowerMonitor::Get()) { |
| 440 scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source( | 442 scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source( |
| 441 new PowerMonitorBroadcastSource()); | 443 new PowerMonitorBroadcastSource()); |
| 442 channel_->AddFilter(power_monitor_source->GetMessageFilter()); | 444 channel_->AddFilter(power_monitor_source->GetMessageFilter()); |
| 443 | 445 |
| 444 power_monitor_.reset(new base::PowerMonitor( | 446 power_monitor_.reset(new base::PowerMonitor( |
| 445 power_monitor_source.Pass())); | 447 power_monitor_source.Pass())); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 void ChildThreadImpl::EnsureConnected() { | 739 void ChildThreadImpl::EnsureConnected() { |
| 738 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 740 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
| 739 base::Process::Current().Terminate(0, false); | 741 base::Process::Current().Terminate(0, false); |
| 740 } | 742 } |
| 741 | 743 |
| 742 bool ChildThreadImpl::IsInBrowserProcess() const { | 744 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 743 return browser_process_io_runner_; | 745 return browser_process_io_runner_; |
| 744 } | 746 } |
| 745 | 747 |
| 746 } // namespace content | 748 } // namespace content |
| OLD | NEW |