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