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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 433 |
433 channel_->AddFilter(histogram_message_filter_.get()); | 434 channel_->AddFilter(histogram_message_filter_.get()); |
434 channel_->AddFilter(resource_message_filter_.get()); | 435 channel_->AddFilter(resource_message_filter_.get()); |
435 channel_->AddFilter(quota_message_filter_->GetFilter()); | 436 channel_->AddFilter(quota_message_filter_->GetFilter()); |
436 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 437 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
437 channel_->AddFilter(push_dispatcher_->GetFilter()); | 438 channel_->AddFilter(push_dispatcher_->GetFilter()); |
438 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 439 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
439 channel_->AddFilter(geofencing_message_filter_->GetFilter()); | 440 channel_->AddFilter(geofencing_message_filter_->GetFilter()); |
440 | 441 |
441 if (!IsInBrowserProcess()) { | 442 if (!IsInBrowserProcess()) { |
442 // In single process mode, browser-side tracing will cover the whole | 443 // In single process mode, browser-side tracing and memory will cover the |
443 // process including renderers. | 444 // whole process including renderers. |
444 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 445 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
445 ChildProcess::current()->io_task_runner())); | 446 ChildProcess::current()->io_task_runner())); |
| 447 channel_->AddFilter(new ChildMemoryMessageFilter()); |
446 } | 448 } |
447 | 449 |
448 // In single process mode we may already have a power monitor | 450 // In single process mode we may already have a power monitor |
449 if (!base::PowerMonitor::Get()) { | 451 if (!base::PowerMonitor::Get()) { |
450 scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source( | 452 scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source( |
451 new PowerMonitorBroadcastSource()); | 453 new PowerMonitorBroadcastSource()); |
452 channel_->AddFilter(power_monitor_source->GetMessageFilter()); | 454 channel_->AddFilter(power_monitor_source->GetMessageFilter()); |
453 | 455 |
454 power_monitor_.reset(new base::PowerMonitor( | 456 power_monitor_.reset(new base::PowerMonitor( |
455 power_monitor_source.Pass())); | 457 power_monitor_source.Pass())); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 void ChildThreadImpl::EnsureConnected() { | 745 void ChildThreadImpl::EnsureConnected() { |
744 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 746 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
745 base::Process::Current().Terminate(0, false); | 747 base::Process::Current().Terminate(0, false); |
746 } | 748 } |
747 | 749 |
748 bool ChildThreadImpl::IsInBrowserProcess() const { | 750 bool ChildThreadImpl::IsInBrowserProcess() const { |
749 return browser_process_io_runner_; | 751 return browser_process_io_runner_; |
750 } | 752 } |
751 | 753 |
752 } // namespace content | 754 } // namespace content |
OLD | NEW |