Chromium Code Reviews| 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 496 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 496 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
| 497 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 497 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
| 498 | 498 |
| 499 if (!IsInBrowserProcess()) { | 499 if (!IsInBrowserProcess()) { |
| 500 // In single process mode, browser-side tracing and memory will cover the | 500 // In single process mode, browser-side tracing and memory will cover the |
| 501 // whole process including renderers. | 501 // whole process including renderers. |
| 502 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 502 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
| 503 ChildProcess::current()->io_task_runner())); | 503 ChildProcess::current()->io_task_runner())); |
| 504 channel_->AddFilter(new ChildMemoryMessageFilter()); | 504 channel_->AddFilter(new ChildMemoryMessageFilter()); |
| 505 | 505 |
| 506 memory_instrumentation::MemoryDumpManagerDelegateImpl::Config config( | 506 if (GetConnector()) { |
|
Lei Zhang
2017/03/25 01:56:34
GetConnector() is service_manager_connection_->Get
Ken Rockot(use gerrit already)
2017/03/25 02:02:48
Thanks. Fixed. /shamecube
| |
| 507 GetConnector(), mojom::kBrowserServiceName); | 507 memory_instrumentation::MemoryDumpManagerDelegateImpl::Config config( |
| 508 auto delegate = | 508 GetConnector(), mojom::kBrowserServiceName); |
| 509 base::MakeUnique<memory_instrumentation::MemoryDumpManagerDelegateImpl>( | 509 auto delegate = base::MakeUnique< |
| 510 config); | 510 memory_instrumentation::MemoryDumpManagerDelegateImpl>(config); |
| 511 base::trace_event::MemoryDumpManager::GetInstance()->Initialize( | 511 base::trace_event::MemoryDumpManager::GetInstance()->Initialize( |
| 512 std::move(delegate)); | 512 std::move(delegate)); |
| 513 } | |
| 513 } | 514 } |
| 514 | 515 |
| 515 // In single process mode we may already have a power monitor, | 516 // In single process mode we may already have a power monitor, |
| 516 // also for some edge cases where there is no ServiceManagerConnection, we do | 517 // also for some edge cases where there is no ServiceManagerConnection, we do |
| 517 // not create the power monitor. | 518 // not create the power monitor. |
| 518 if (!base::PowerMonitor::Get() && service_manager_connection_) { | 519 if (!base::PowerMonitor::Get() && service_manager_connection_) { |
| 519 std::unique_ptr<service_manager::Connection> device_connection = | 520 std::unique_ptr<service_manager::Connection> device_connection = |
| 520 service_manager_connection_->GetConnector()->Connect( | 521 service_manager_connection_->GetConnector()->Connect( |
| 521 device::mojom::kServiceName); | 522 device::mojom::kServiceName); |
| 522 auto power_monitor_source = | 523 auto power_monitor_source = |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 874 connected_to_browser_ = true; | 875 connected_to_browser_ = true; |
| 875 child_info_ = local_info; | 876 child_info_ = local_info; |
| 876 browser_info_ = remote_info; | 877 browser_info_ = remote_info; |
| 877 } | 878 } |
| 878 | 879 |
| 879 bool ChildThreadImpl::IsInBrowserProcess() const { | 880 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 880 return static_cast<bool>(browser_process_io_runner_); | 881 return static_cast<bool>(browser_process_io_runner_); |
| 881 } | 882 } |
| 882 | 883 |
| 883 } // namespace content | 884 } // namespace content |
| OLD | NEW |