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 14 matching lines...) Expand all Loading... |
25 #include "base/process/process_handle.h" | 25 #include "base/process/process_handle.h" |
26 #include "base/single_thread_task_runner.h" | 26 #include "base/single_thread_task_runner.h" |
27 #include "base/strings/string_number_conversions.h" | 27 #include "base/strings/string_number_conversions.h" |
28 #include "base/strings/string_util.h" | 28 #include "base/strings/string_util.h" |
29 #include "base/synchronization/condition_variable.h" | 29 #include "base/synchronization/condition_variable.h" |
30 #include "base/synchronization/lock.h" | 30 #include "base/synchronization/lock.h" |
31 #include "base/threading/thread_local.h" | 31 #include "base/threading/thread_local.h" |
32 #include "base/threading/thread_task_runner_handle.h" | 32 #include "base/threading/thread_task_runner_handle.h" |
33 #include "base/timer/elapsed_timer.h" | 33 #include "base/timer/elapsed_timer.h" |
34 #include "base/trace_event/memory_dump_manager.h" | 34 #include "base/trace_event/memory_dump_manager.h" |
| 35 #include "base/trace_event/memory_tracing_frontend.h" |
35 #include "base/tracked_objects.h" | 36 #include "base/tracked_objects.h" |
36 #include "build/build_config.h" | 37 #include "build/build_config.h" |
37 #include "components/tracing/child/child_trace_message_filter.h" | 38 #include "components/tracing/child/child_trace_message_filter.h" |
38 #include "content/child/child_histogram_message_filter.h" | 39 #include "content/child/child_histogram_message_filter.h" |
39 #include "content/child/child_process.h" | 40 #include "content/child/child_process.h" |
40 #include "content/child/child_resource_message_filter.h" | 41 #include "content/child/child_resource_message_filter.h" |
41 #include "content/child/fileapi/file_system_dispatcher.h" | 42 #include "content/child/fileapi/file_system_dispatcher.h" |
42 #include "content/child/fileapi/webfilesystem_impl.h" | 43 #include "content/child/fileapi/webfilesystem_impl.h" |
43 #include "content/child/memory/child_memory_message_filter.h" | 44 #include "content/child/memory/child_memory_message_filter.h" |
44 #include "content/child/notifications/notification_dispatcher.h" | 45 #include "content/child/notifications/notification_dispatcher.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 ChildProcess::current()->io_task_runner())); | 497 ChildProcess::current()->io_task_runner())); |
497 channel_->AddFilter(new ChildMemoryMessageFilter()); | 498 channel_->AddFilter(new ChildMemoryMessageFilter()); |
498 | 499 |
499 if (service_manager_connection_) { | 500 if (service_manager_connection_) { |
500 memory_instrumentation::MemoryDumpManagerDelegateImpl::Config config( | 501 memory_instrumentation::MemoryDumpManagerDelegateImpl::Config config( |
501 GetConnector(), mojom::kBrowserServiceName); | 502 GetConnector(), mojom::kBrowserServiceName); |
502 auto delegate = base::MakeUnique< | 503 auto delegate = base::MakeUnique< |
503 memory_instrumentation::MemoryDumpManagerDelegateImpl>(config); | 504 memory_instrumentation::MemoryDumpManagerDelegateImpl>(config); |
504 base::trace_event::MemoryDumpManager::GetInstance()->Initialize( | 505 base::trace_event::MemoryDumpManager::GetInstance()->Initialize( |
505 std::move(delegate)); | 506 std::move(delegate)); |
| 507 base::trace_event::MemoryTracingFrontend::Initialize( |
| 508 base::trace_event::MemoryDumpManager::GetInstance()); |
506 } | 509 } |
507 } | 510 } |
508 | 511 |
509 // In single process mode we may already have a power monitor, | 512 // In single process mode we may already have a power monitor, |
510 // also for some edge cases where there is no ServiceManagerConnection, we do | 513 // also for some edge cases where there is no ServiceManagerConnection, we do |
511 // not create the power monitor. | 514 // not create the power monitor. |
512 if (!base::PowerMonitor::Get() && service_manager_connection_) { | 515 if (!base::PowerMonitor::Get() && service_manager_connection_) { |
513 std::unique_ptr<service_manager::Connection> device_connection = | 516 std::unique_ptr<service_manager::Connection> device_connection = |
514 service_manager_connection_->GetConnector()->Connect( | 517 service_manager_connection_->GetConnector()->Connect( |
515 device::mojom::kServiceName); | 518 device::mojom::kServiceName); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 connected_to_browser_ = true; | 879 connected_to_browser_ = true; |
877 child_info_ = local_info; | 880 child_info_ = local_info; |
878 browser_info_ = remote_info; | 881 browser_info_ = remote_info; |
879 } | 882 } |
880 | 883 |
881 bool ChildThreadImpl::IsInBrowserProcess() const { | 884 bool ChildThreadImpl::IsInBrowserProcess() const { |
882 return static_cast<bool>(browser_process_io_runner_); | 885 return static_cast<bool>(browser_process_io_runner_); |
883 } | 886 } |
884 | 887 |
885 } // namespace content | 888 } // namespace content |
OLD | NEW |