| 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/mojo/mojo_shell_context.h" | |
| 31 #include "content/browser/profiler_message_filter.h" | 30 #include "content/browser/profiler_message_filter.h" |
| 31 #include "content/browser/service_manager/service_manager_context.h" |
| 32 #include "content/browser/tracing/trace_message_filter.h" | 32 #include "content/browser/tracing/trace_message_filter.h" |
| 33 #include "content/common/child_process_host_impl.h" | 33 #include "content/common/child_process_host_impl.h" |
| 34 #include "content/common/child_process_messages.h" | 34 #include "content/common/child_process_messages.h" |
| 35 #include "content/common/mojo/mojo_child_connection.h" | 35 #include "content/common/mojo/mojo_child_connection.h" |
| 36 #include "content/public/browser/browser_child_process_host_delegate.h" | 36 #include "content/public/browser/browser_child_process_host_delegate.h" |
| 37 #include "content/public/browser/browser_child_process_observer.h" | 37 #include "content/public/browser/browser_child_process_observer.h" |
| 38 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 39 #include "content/public/browser/child_process_data.h" | 39 #include "content/public/browser/child_process_data.h" |
| 40 #include "content/public/browser/content_browser_client.h" | 40 #include "content/public/browser/content_browser_client.h" |
| 41 #include "content/public/common/content_switches.h" | 41 #include "content/public/common/content_switches.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 g_child_process_list.Get().push_back(this); | 171 g_child_process_list.Get().push_back(this); |
| 172 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); | 172 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); |
| 173 | 173 |
| 174 power_monitor_message_broadcaster_.Init(); | 174 power_monitor_message_broadcaster_.Init(); |
| 175 | 175 |
| 176 if (!service_name.empty()) { | 176 if (!service_name.empty()) { |
| 177 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 177 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 178 child_connection_.reset(new MojoChildConnection( | 178 child_connection_.reset(new MojoChildConnection( |
| 179 service_name, base::StringPrintf("%d", data_.id), child_token_, | 179 service_name, base::StringPrintf("%d", data_.id), child_token_, |
| 180 MojoShellContext::GetConnectorForIOThread(), | 180 ServiceManagerContext::GetConnectorForIOThread(), |
| 181 base::ThreadTaskRunnerHandle::Get())); | 181 base::ThreadTaskRunnerHandle::Get())); |
| 182 } | 182 } |
| 183 | 183 |
| 184 // Create a persistent memory segment for subprocess histograms. | 184 // Create a persistent memory segment for subprocess histograms. |
| 185 CreateMetricsAllocator(); | 185 CreateMetricsAllocator(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 BrowserChildProcessHostImpl::~BrowserChildProcessHostImpl() { | 188 BrowserChildProcessHostImpl::~BrowserChildProcessHostImpl() { |
| 189 g_child_process_list.Get().remove(this); | 189 g_child_process_list.Get().remove(this); |
| 190 | 190 |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 | 602 |
| 603 #if defined(OS_WIN) | 603 #if defined(OS_WIN) |
| 604 | 604 |
| 605 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 605 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
| 606 OnChildDisconnected(); | 606 OnChildDisconnected(); |
| 607 } | 607 } |
| 608 | 608 |
| 609 #endif | 609 #endif |
| 610 | 610 |
| 611 } // namespace content | 611 } // namespace content |
| OLD | NEW |