Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: content/child/child_thread_impl.cc

Issue 2738093003: Revert of memory-infra: Finish moving to Mojo (2nd attempt) (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/DEPS ('k') | content/common/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #include "ipc/ipc_sync_channel.h" 59 #include "ipc/ipc_sync_channel.h"
60 #include "ipc/ipc_sync_message_filter.h" 60 #include "ipc/ipc_sync_message_filter.h"
61 #include "mojo/edk/embedder/embedder.h" 61 #include "mojo/edk/embedder/embedder.h"
62 #include "mojo/edk/embedder/named_platform_channel_pair.h" 62 #include "mojo/edk/embedder/named_platform_channel_pair.h"
63 #include "mojo/edk/embedder/platform_channel_pair.h" 63 #include "mojo/edk/embedder/platform_channel_pair.h"
64 #include "mojo/edk/embedder/scoped_ipc_support.h" 64 #include "mojo/edk/embedder/scoped_ipc_support.h"
65 #include "mojo/public/cpp/system/buffer.h" 65 #include "mojo/public/cpp/system/buffer.h"
66 #include "mojo/public/cpp/system/platform_handle.h" 66 #include "mojo/public/cpp/system/platform_handle.h"
67 #include "services/device/public/cpp/power_monitor/power_monitor_broadcast_sourc e.h" 67 #include "services/device/public/cpp/power_monitor/power_monitor_broadcast_sourc e.h"
68 #include "services/device/public/interfaces/constants.mojom.h" 68 #include "services/device/public/interfaces/constants.mojom.h"
69 #include "services/resource_coordinator/public/cpp/memory/memory_dump_manager_de legate_impl.h"
70 #include "services/service_manager/public/cpp/connector.h" 69 #include "services/service_manager/public/cpp/connector.h"
71 #include "services/service_manager/public/cpp/interface_factory.h" 70 #include "services/service_manager/public/cpp/interface_factory.h"
72 #include "services/service_manager/public/cpp/interface_provider.h" 71 #include "services/service_manager/public/cpp/interface_provider.h"
73 #include "services/service_manager/public/cpp/interface_registry.h" 72 #include "services/service_manager/public/cpp/interface_registry.h"
74 #include "services/service_manager/runner/common/client_util.h" 73 #include "services/service_manager/runner/common/client_util.h"
75 74
76 #if defined(OS_POSIX) 75 #if defined(OS_POSIX)
77 #include "base/posix/global_descriptors.h" 76 #include "base/posix/global_descriptors.h"
78 #include "content/public/common/content_descriptors.h" 77 #include "content/public/common/content_descriptors.h"
79 #endif 78 #endif
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 channel_->AddFilter(quota_message_filter_->GetFilter()); 496 channel_->AddFilter(quota_message_filter_->GetFilter());
498 channel_->AddFilter(notification_dispatcher_->GetFilter()); 497 channel_->AddFilter(notification_dispatcher_->GetFilter());
499 channel_->AddFilter(service_worker_message_filter_->GetFilter()); 498 channel_->AddFilter(service_worker_message_filter_->GetFilter());
500 499
501 if (!IsInBrowserProcess()) { 500 if (!IsInBrowserProcess()) {
502 // In single process mode, browser-side tracing and memory will cover the 501 // In single process mode, browser-side tracing and memory will cover the
503 // whole process including renderers. 502 // whole process including renderers.
504 channel_->AddFilter(new tracing::ChildTraceMessageFilter( 503 channel_->AddFilter(new tracing::ChildTraceMessageFilter(
505 ChildProcess::current()->io_task_runner())); 504 ChildProcess::current()->io_task_runner()));
506 channel_->AddFilter(new ChildMemoryMessageFilter()); 505 channel_->AddFilter(new ChildMemoryMessageFilter());
507
508 memory_instrumentation::MemoryDumpManagerDelegateImpl::Config config(
509 GetRemoteInterfaces());
510 memory_instrumentation::MemoryDumpManagerDelegateImpl::Create(config);
511 } 506 }
512 507
513 // In single process mode we may already have a power monitor, 508 // In single process mode we may already have a power monitor,
514 // also for some edge cases where there is no ServiceManagerConnection, we do 509 // also for some edge cases where there is no ServiceManagerConnection, we do
515 // not create the power monitor. 510 // not create the power monitor.
516 if (!base::PowerMonitor::Get() && service_manager_connection_) { 511 if (!base::PowerMonitor::Get() && service_manager_connection_) {
517 std::unique_ptr<service_manager::Connection> device_connection = 512 std::unique_ptr<service_manager::Connection> device_connection =
518 service_manager_connection_->GetConnector()->Connect( 513 service_manager_connection_->GetConnector()->Connect(
519 device::mojom::kServiceName); 514 device::mojom::kServiceName);
520 auto power_monitor_source = 515 auto power_monitor_source =
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 connected_to_browser_ = true; 872 connected_to_browser_ = true;
878 child_info_ = local_info; 873 child_info_ = local_info;
879 browser_info_ = remote_info; 874 browser_info_ = remote_info;
880 } 875 }
881 876
882 bool ChildThreadImpl::IsInBrowserProcess() const { 877 bool ChildThreadImpl::IsInBrowserProcess() const {
883 return static_cast<bool>(browser_process_io_runner_); 878 return static_cast<bool>(browser_process_io_runner_);
884 } 879 }
885 880
886 } // namespace content 881 } // namespace content
OLDNEW
« no previous file with comments | « content/child/DEPS ('k') | content/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698