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

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

Issue 2741203002: memory-infra: Finish moving to Mojo (3nd attempt) (Closed)
Patch Set: rebase 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 13 matching lines...) Expand all
24 #include "base/process/process.h" 24 #include "base/process/process.h"
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/tracked_objects.h" 35 #include "base/tracked_objects.h"
35 #include "build/build_config.h" 36 #include "build/build_config.h"
36 #include "components/tracing/child/child_trace_message_filter.h" 37 #include "components/tracing/child/child_trace_message_filter.h"
37 #include "content/child/child_histogram_message_filter.h" 38 #include "content/child/child_histogram_message_filter.h"
38 #include "content/child/child_process.h" 39 #include "content/child/child_process.h"
39 #include "content/child/child_resource_message_filter.h" 40 #include "content/child/child_resource_message_filter.h"
40 #include "content/child/fileapi/file_system_dispatcher.h" 41 #include "content/child/fileapi/file_system_dispatcher.h"
41 #include "content/child/fileapi/webfilesystem_impl.h" 42 #include "content/child/fileapi/webfilesystem_impl.h"
42 #include "content/child/memory/child_memory_message_filter.h" 43 #include "content/child/memory/child_memory_message_filter.h"
43 #include "content/child/notifications/notification_dispatcher.h" 44 #include "content/child/notifications/notification_dispatcher.h"
(...skipping 15 matching lines...) Expand all
59 #include "ipc/ipc_sync_channel.h" 60 #include "ipc/ipc_sync_channel.h"
60 #include "ipc/ipc_sync_message_filter.h" 61 #include "ipc/ipc_sync_message_filter.h"
61 #include "mojo/edk/embedder/embedder.h" 62 #include "mojo/edk/embedder/embedder.h"
62 #include "mojo/edk/embedder/named_platform_channel_pair.h" 63 #include "mojo/edk/embedder/named_platform_channel_pair.h"
63 #include "mojo/edk/embedder/platform_channel_pair.h" 64 #include "mojo/edk/embedder/platform_channel_pair.h"
64 #include "mojo/edk/embedder/scoped_ipc_support.h" 65 #include "mojo/edk/embedder/scoped_ipc_support.h"
65 #include "mojo/public/cpp/system/buffer.h" 66 #include "mojo/public/cpp/system/buffer.h"
66 #include "mojo/public/cpp/system/platform_handle.h" 67 #include "mojo/public/cpp/system/platform_handle.h"
67 #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"
68 #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"
69 #include "services/service_manager/public/cpp/connector.h" 71 #include "services/service_manager/public/cpp/connector.h"
70 #include "services/service_manager/public/cpp/interface_factory.h" 72 #include "services/service_manager/public/cpp/interface_factory.h"
71 #include "services/service_manager/public/cpp/interface_provider.h" 73 #include "services/service_manager/public/cpp/interface_provider.h"
72 #include "services/service_manager/public/cpp/interface_registry.h" 74 #include "services/service_manager/public/cpp/interface_registry.h"
73 #include "services/service_manager/runner/common/client_util.h" 75 #include "services/service_manager/runner/common/client_util.h"
74 76
75 #if defined(OS_POSIX) 77 #if defined(OS_POSIX)
76 #include "base/posix/global_descriptors.h" 78 #include "base/posix/global_descriptors.h"
77 #include "content/public/common/content_descriptors.h" 79 #include "content/public/common/content_descriptors.h"
78 #endif 80 #endif
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 channel_->AddFilter(quota_message_filter_->GetFilter()); 498 channel_->AddFilter(quota_message_filter_->GetFilter());
497 channel_->AddFilter(notification_dispatcher_->GetFilter()); 499 channel_->AddFilter(notification_dispatcher_->GetFilter());
498 channel_->AddFilter(service_worker_message_filter_->GetFilter()); 500 channel_->AddFilter(service_worker_message_filter_->GetFilter());
499 501
500 if (!IsInBrowserProcess()) { 502 if (!IsInBrowserProcess()) {
501 // In single process mode, browser-side tracing and memory will cover the 503 // In single process mode, browser-side tracing and memory will cover the
502 // whole process including renderers. 504 // whole process including renderers.
503 channel_->AddFilter(new tracing::ChildTraceMessageFilter( 505 channel_->AddFilter(new tracing::ChildTraceMessageFilter(
504 ChildProcess::current()->io_task_runner())); 506 ChildProcess::current()->io_task_runner()));
505 channel_->AddFilter(new ChildMemoryMessageFilter()); 507 channel_->AddFilter(new ChildMemoryMessageFilter());
508
509 memory_instrumentation::MemoryDumpManagerDelegateImpl::Config config(
510 GetRemoteInterfaces());
511 auto delegate =
512 base::MakeUnique<memory_instrumentation::MemoryDumpManagerDelegateImpl>(
513 config);
514 base::trace_event::MemoryDumpManager::GetInstance()->Initialize(
515 std::move(delegate));
506 } 516 }
507 517
508 // In single process mode we may already have a power monitor, 518 // In single process mode we may already have a power monitor,
509 // also for some edge cases where there is no ServiceManagerConnection, we do 519 // also for some edge cases where there is no ServiceManagerConnection, we do
510 // not create the power monitor. 520 // not create the power monitor.
511 if (!base::PowerMonitor::Get() && service_manager_connection_) { 521 if (!base::PowerMonitor::Get() && service_manager_connection_) {
512 std::unique_ptr<service_manager::Connection> device_connection = 522 std::unique_ptr<service_manager::Connection> device_connection =
513 service_manager_connection_->GetConnector()->Connect( 523 service_manager_connection_->GetConnector()->Connect(
514 device::mojom::kServiceName); 524 device::mojom::kServiceName);
515 auto power_monitor_source = 525 auto power_monitor_source =
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 connected_to_browser_ = true; 882 connected_to_browser_ = true;
873 child_info_ = local_info; 883 child_info_ = local_info;
874 browser_info_ = remote_info; 884 browser_info_ = remote_info;
875 } 885 }
876 886
877 bool ChildThreadImpl::IsInBrowserProcess() const { 887 bool ChildThreadImpl::IsInBrowserProcess() const {
878 return static_cast<bool>(browser_process_io_runner_); 888 return static_cast<bool>(browser_process_io_runner_);
879 } 889 }
880 890
881 } // namespace content 891 } // 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