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 24 matching lines...) Expand all Loading... |
35 #include "components/discardable_memory/client/client_discardable_shared_memory_
manager.h" | 35 #include "components/discardable_memory/client/client_discardable_shared_memory_
manager.h" |
36 #include "components/tracing/child/child_trace_message_filter.h" | 36 #include "components/tracing/child/child_trace_message_filter.h" |
37 #include "content/child/child_histogram_message_filter.h" | 37 #include "content/child/child_histogram_message_filter.h" |
38 #include "content/child/child_process.h" | 38 #include "content/child/child_process.h" |
39 #include "content/child/child_resource_message_filter.h" | 39 #include "content/child/child_resource_message_filter.h" |
40 #include "content/child/child_shared_bitmap_manager.h" | 40 #include "content/child/child_shared_bitmap_manager.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" | 43 #include "content/child/memory/child_memory_message_filter.h" |
44 #include "content/child/notifications/notification_dispatcher.h" | 44 #include "content/child/notifications/notification_dispatcher.h" |
45 #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/common/child_process_messages.h" | 51 #include "content/common/child_process_messages.h" |
53 #include "content/common/in_process_child_thread_params.h" | 52 #include "content/common/in_process_child_thread_params.h" |
54 #include "content/public/common/connection_filter.h" | 53 #include "content/public/common/connection_filter.h" |
55 #include "content/public/common/content_switches.h" | 54 #include "content/public/common/content_switches.h" |
56 #include "content/public/common/mojo_channel_switches.h" | 55 #include "content/public/common/mojo_channel_switches.h" |
57 #include "content/public/common/service_manager_connection.h" | 56 #include "content/public/common/service_manager_connection.h" |
58 #include "content/public/common/service_names.h" | 57 #include "content/public/common/service_names.h" |
| 58 #include "device/power_monitor/public/cpp/power_monitor_broadcast_source.h" |
59 #include "ipc/ipc_channel_mojo.h" | 59 #include "ipc/ipc_channel_mojo.h" |
60 #include "ipc/ipc_logging.h" | 60 #include "ipc/ipc_logging.h" |
61 #include "ipc/ipc_platform_file.h" | 61 #include "ipc/ipc_platform_file.h" |
62 #include "ipc/ipc_sync_channel.h" | 62 #include "ipc/ipc_sync_channel.h" |
63 #include "ipc/ipc_sync_message_filter.h" | 63 #include "ipc/ipc_sync_message_filter.h" |
64 #include "mojo/edk/embedder/embedder.h" | 64 #include "mojo/edk/embedder/embedder.h" |
65 #include "mojo/edk/embedder/named_platform_channel_pair.h" | 65 #include "mojo/edk/embedder/named_platform_channel_pair.h" |
66 #include "mojo/edk/embedder/platform_channel_pair.h" | 66 #include "mojo/edk/embedder/platform_channel_pair.h" |
67 #include "mojo/edk/embedder/scoped_ipc_support.h" | 67 #include "mojo/edk/embedder/scoped_ipc_support.h" |
68 #include "services/service_manager/public/cpp/connector.h" | 68 #include "services/service_manager/public/cpp/connector.h" |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 if (!IsInBrowserProcess()) { | 531 if (!IsInBrowserProcess()) { |
532 // In single process mode, browser-side tracing and memory will cover the | 532 // In single process mode, browser-side tracing and memory will cover the |
533 // whole process including renderers. | 533 // whole process including renderers. |
534 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 534 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
535 ChildProcess::current()->io_task_runner())); | 535 ChildProcess::current()->io_task_runner())); |
536 channel_->AddFilter(new ChildMemoryMessageFilter()); | 536 channel_->AddFilter(new ChildMemoryMessageFilter()); |
537 } | 537 } |
538 | 538 |
539 // In single process mode we may already have a power monitor | 539 // In single process mode we may already have a power monitor |
540 if (!base::PowerMonitor::Get()) { | 540 if (!base::PowerMonitor::Get()) { |
541 std::unique_ptr<PowerMonitorBroadcastSource> power_monitor_source( | 541 std::unique_ptr<device::PowerMonitorBroadcastSource> power_monitor_source( |
542 new PowerMonitorBroadcastSource()); | 542 new device::PowerMonitorBroadcastSource(GetRemoteInterfaces())); |
| 543 |
543 power_monitor_.reset( | 544 power_monitor_.reset( |
544 new base::PowerMonitor(std::move(power_monitor_source))); | 545 new base::PowerMonitor(std::move(power_monitor_source))); |
545 } | 546 } |
546 | 547 |
547 #if defined(OS_POSIX) | 548 #if defined(OS_POSIX) |
548 // Check that --process-type is specified so we don't do this in unit tests | 549 // Check that --process-type is specified so we don't do this in unit tests |
549 // and single-process mode. | 550 // and single-process mode. |
550 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) | 551 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) |
551 channel_->AddFilter(new SuicideOnChannelErrorFilter()); | 552 channel_->AddFilter(new SuicideOnChannelErrorFilter()); |
552 #endif | 553 #endif |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 connected_to_browser_ = true; | 918 connected_to_browser_ = true; |
918 child_info_ = local_info; | 919 child_info_ = local_info; |
919 browser_info_ = remote_info; | 920 browser_info_ = remote_info; |
920 } | 921 } |
921 | 922 |
922 bool ChildThreadImpl::IsInBrowserProcess() const { | 923 bool ChildThreadImpl::IsInBrowserProcess() const { |
923 return static_cast<bool>(browser_process_io_runner_); | 924 return static_cast<bool>(browser_process_io_runner_); |
924 } | 925 } |
925 | 926 |
926 } // namespace content | 927 } // namespace content |
OLD | NEW |