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