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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 #include "ipc/ipc_sync_channel.h" | 60 #include "ipc/ipc_sync_channel.h" |
| 61 #include "ipc/ipc_sync_message_filter.h" | 61 #include "ipc/ipc_sync_message_filter.h" |
| 62 #include "mojo/edk/embedder/embedder.h" | 62 #include "mojo/edk/embedder/embedder.h" |
| 63 #include "mojo/edk/embedder/named_platform_channel_pair.h" | 63 #include "mojo/edk/embedder/named_platform_channel_pair.h" |
| 64 #include "mojo/edk/embedder/platform_channel_pair.h" | 64 #include "mojo/edk/embedder/platform_channel_pair.h" |
| 65 #include "mojo/edk/embedder/scoped_ipc_support.h" | 65 #include "mojo/edk/embedder/scoped_ipc_support.h" |
| 66 #include "mojo/public/cpp/system/buffer.h" | 66 #include "mojo/public/cpp/system/buffer.h" |
| 67 #include "mojo/public/cpp/system/platform_handle.h" | 67 #include "mojo/public/cpp/system/platform_handle.h" |
| 68 #include "services/device/public/cpp/power_monitor/power_monitor_broadcast_sourc e.h" | 68 #include "services/device/public/cpp/power_monitor/power_monitor_broadcast_sourc e.h" |
| 69 #include "services/device/public/interfaces/constants.mojom.h" | 69 #include "services/device/public/interfaces/constants.mojom.h" |
| 70 #include "services/resource_coordinator/public/cpp/memory/memory_dump_manager_de legate_impl.h" | |
| 70 #include "services/service_manager/public/cpp/connector.h" | 71 #include "services/service_manager/public/cpp/connector.h" |
| 71 #include "services/service_manager/public/cpp/interface_factory.h" | 72 #include "services/service_manager/public/cpp/interface_factory.h" |
| 72 #include "services/service_manager/public/cpp/interface_provider.h" | 73 #include "services/service_manager/public/cpp/interface_provider.h" |
| 73 #include "services/service_manager/public/cpp/interface_registry.h" | 74 #include "services/service_manager/public/cpp/interface_registry.h" |
| 74 #include "services/service_manager/runner/common/client_util.h" | 75 #include "services/service_manager/runner/common/client_util.h" |
| 75 | 76 |
| 76 #if defined(OS_POSIX) | 77 #if defined(OS_POSIX) |
| 77 #include "base/posix/global_descriptors.h" | 78 #include "base/posix/global_descriptors.h" |
| 78 #include "content/public/common/content_descriptors.h" | 79 #include "content/public/common/content_descriptors.h" |
| 79 #endif | 80 #endif |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 498 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 499 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
| 499 channel_->AddFilter(push_dispatcher_->GetFilter()); | 500 channel_->AddFilter(push_dispatcher_->GetFilter()); |
| 500 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 501 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
| 501 | 502 |
| 502 if (!IsInBrowserProcess()) { | 503 if (!IsInBrowserProcess()) { |
| 503 // In single process mode, browser-side tracing and memory will cover the | 504 // In single process mode, browser-side tracing and memory will cover the |
| 504 // whole process including renderers. | 505 // whole process including renderers. |
| 505 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 506 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
| 506 ChildProcess::current()->io_task_runner())); | 507 ChildProcess::current()->io_task_runner())); |
| 507 channel_->AddFilter(new ChildMemoryMessageFilter()); | 508 channel_->AddFilter(new ChildMemoryMessageFilter()); |
| 509 | |
| 510 std::unique_ptr<memory_instrumentation::MemoryDumpManagerDelegateImpl> | |
|
oystein (OOO til 10th of July)
2017/02/16 20:50:01
auto delegate = base::MakeUnique<MemoryDumpManager
chiniforooshan
2017/02/16 22:54:15
Done.
| |
| 511 delegate(new memory_instrumentation::MemoryDumpManagerDelegateImpl( | |
| 512 GetRemoteInterfaces())); | |
| 513 base::trace_event::MemoryDumpManager::GetInstance()->Initialize( | |
| 514 std::move(delegate)); | |
| 508 } | 515 } |
| 509 | 516 |
| 510 // In single process mode we may already have a power monitor, | 517 // In single process mode we may already have a power monitor, |
| 511 // also for some edge cases where there is no ServiceManagerConnection, we do | 518 // also for some edge cases where there is no ServiceManagerConnection, we do |
| 512 // not create the power monitor. | 519 // not create the power monitor. |
| 513 if (!base::PowerMonitor::Get() && service_manager_connection_) { | 520 if (!base::PowerMonitor::Get() && service_manager_connection_) { |
| 514 std::unique_ptr<service_manager::Connection> device_connection = | 521 std::unique_ptr<service_manager::Connection> device_connection = |
| 515 service_manager_connection_->GetConnector()->Connect( | 522 service_manager_connection_->GetConnector()->Connect( |
| 516 device::mojom::kServiceName); | 523 device::mojom::kServiceName); |
| 517 auto power_monitor_source = | 524 auto power_monitor_source = |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 874 connected_to_browser_ = true; | 881 connected_to_browser_ = true; |
| 875 child_info_ = local_info; | 882 child_info_ = local_info; |
| 876 browser_info_ = remote_info; | 883 browser_info_ = remote_info; |
| 877 } | 884 } |
| 878 | 885 |
| 879 bool ChildThreadImpl::IsInBrowserProcess() const { | 886 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 880 return static_cast<bool>(browser_process_io_runner_); | 887 return static_cast<bool>(browser_process_io_runner_); |
| 881 } | 888 } |
| 882 | 889 |
| 883 } // namespace content | 890 } // namespace content |
| OLD | NEW |