| 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/browser/browser_child_process_host_impl.h" | 5 #include "content/browser/browser_child_process_host_impl.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/dump_without_crashing.h" | 10 #include "base/debug/dump_without_crashing.h" |
| 11 #include "base/feature_list.h" | 11 #include "base/feature_list.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
| 17 #include "base/metrics/histogram_macros.h" | 17 #include "base/metrics/histogram_macros.h" |
| 18 #include "base/metrics/persistent_histogram_allocator.h" | 18 #include "base/metrics/persistent_histogram_allocator.h" |
| 19 #include "base/metrics/persistent_memory_allocator.h" | 19 #include "base/metrics/persistent_memory_allocator.h" |
| 20 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
| 21 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
| 22 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
| 23 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
| 24 #include "base/threading/thread_task_runner_handle.h" | 24 #include "base/threading/thread_task_runner_handle.h" |
| 25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 26 #include "components/tracing/common/tracing_switches.h" | 26 #include "components/tracing/common/tracing_switches.h" |
| 27 #include "content/browser/histogram_message_filter.h" | 27 #include "content/browser/histogram_message_filter.h" |
| 28 #include "content/browser/loader/resource_message_filter.h" | 28 #include "content/browser/loader/resource_message_filter.h" |
| 29 #include "content/browser/memory/memory_message_filter.h" | 29 #include "content/browser/memory/memory_message_filter.h" |
| 30 #include "content/browser/power_monitor_message_broadcaster.h" | |
| 31 #include "content/browser/profiler_message_filter.h" | 30 #include "content/browser/profiler_message_filter.h" |
| 32 #include "content/browser/service_manager/service_manager_context.h" | 31 #include "content/browser/service_manager/service_manager_context.h" |
| 33 #include "content/browser/tracing/trace_message_filter.h" | 32 #include "content/browser/tracing/trace_message_filter.h" |
| 34 #include "content/common/child_process_host_impl.h" | 33 #include "content/common/child_process_host_impl.h" |
| 35 #include "content/common/child_process_messages.h" | 34 #include "content/common/child_process_messages.h" |
| 36 #include "content/common/service_manager/child_connection.h" | 35 #include "content/common/service_manager/child_connection.h" |
| 37 #include "content/public/browser/browser_child_process_host_delegate.h" | 36 #include "content/public/browser/browser_child_process_host_delegate.h" |
| 38 #include "content/public/browser/browser_child_process_observer.h" | 37 #include "content/public/browser/browser_child_process_observer.h" |
| 39 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 40 #include "content/public/browser/child_process_data.h" | 39 #include "content/public/browser/child_process_data.h" |
| 41 #include "content/public/browser/content_browser_client.h" | 40 #include "content/public/browser/content_browser_client.h" |
| 42 #include "content/public/common/connection_filter.h" | 41 #include "content/public/common/connection_filter.h" |
| 43 #include "content/public/common/content_features.h" | 42 #include "content/public/common/content_features.h" |
| 44 #include "content/public/common/content_switches.h" | 43 #include "content/public/common/content_switches.h" |
| 45 #include "content/public/common/mojo_channel_switches.h" | 44 #include "content/public/common/mojo_channel_switches.h" |
| 46 #include "content/public/common/process_type.h" | 45 #include "content/public/common/process_type.h" |
| 47 #include "content/public/common/result_codes.h" | 46 #include "content/public/common/result_codes.h" |
| 48 #include "content/public/common/service_manager_connection.h" | 47 #include "content/public/common/service_manager_connection.h" |
| 48 #include "device/power_monitor/power_monitor_message_broadcaster.h" |
| 49 #include "mojo/edk/embedder/embedder.h" | 49 #include "mojo/edk/embedder/embedder.h" |
| 50 #include "services/service_manager/public/cpp/interface_registry.h" | 50 #include "services/service_manager/public/cpp/interface_registry.h" |
| 51 | 51 |
| 52 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
| 53 #include "content/browser/mach_broker_mac.h" | 53 #include "content/browser/mach_broker_mac.h" |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 namespace content { | 56 namespace content { |
| 57 namespace { | 57 namespace { |
| 58 | 58 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 89 | 89 |
| 90 class ConnectionFilterImpl : public ConnectionFilter { | 90 class ConnectionFilterImpl : public ConnectionFilter { |
| 91 public: | 91 public: |
| 92 ConnectionFilterImpl() {} | 92 ConnectionFilterImpl() {} |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 // ConnectionFilter: | 95 // ConnectionFilter: |
| 96 bool OnConnect(const service_manager::Identity& remote_identity, | 96 bool OnConnect(const service_manager::Identity& remote_identity, |
| 97 service_manager::InterfaceRegistry* registry, | 97 service_manager::InterfaceRegistry* registry, |
| 98 service_manager::Connector* connector) override { | 98 service_manager::Connector* connector) override { |
| 99 registry->AddInterface(base::Bind(&PowerMonitorMessageBroadcaster::Create)); | 99 registry->AddInterface( |
| 100 base::Bind(&device::PowerMonitorMessageBroadcaster::Create)); |
| 100 return true; | 101 return true; |
| 101 } | 102 } |
| 102 | 103 |
| 103 DISALLOW_COPY_AND_ASSIGN(ConnectionFilterImpl); | 104 DISALLOW_COPY_AND_ASSIGN(ConnectionFilterImpl); |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 } // namespace | 107 } // namespace |
| 107 | 108 |
| 108 BrowserChildProcessHost* BrowserChildProcessHost::Create( | 109 BrowserChildProcessHost* BrowserChildProcessHost::Create( |
| 109 content::ProcessType process_type, | 110 content::ProcessType process_type, |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 | 605 |
| 605 #if defined(OS_WIN) | 606 #if defined(OS_WIN) |
| 606 | 607 |
| 607 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 608 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
| 608 OnChildDisconnected(); | 609 OnChildDisconnected(); |
| 609 } | 610 } |
| 610 | 611 |
| 611 #endif | 612 #endif |
| 612 | 613 |
| 613 } // namespace content | 614 } // namespace content |
| OLD | NEW |