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

Unified Diff: content/child/child_thread_impl.cc

Issue 2871223002: memory-infra: add ProcessType and expose data in RequestGlobalDump() (Closed)
Patch Set: review comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index 4c231deda83f1e105563fbe824e2b7dd8ec2b451..121d9319f2eb7b72a73e2a7c35396cd0c5beaa12 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -67,6 +67,7 @@
#include "mojo/public/cpp/system/platform_handle.h"
#include "services/device/public/cpp/power_monitor/power_monitor_broadcast_source.h"
#include "services/resource_coordinator/public/cpp/memory/process_local_dump_manager_impl.h"
+#include "services/resource_coordinator/public/interfaces/memory/memory_instrumentation.mojom.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "services/service_manager/runner/common/client_util.h"
@@ -487,8 +488,21 @@ void ChildThreadImpl::Init(const Options& options) {
channel_->AddFilter(new ChildMemoryMessageFilter());
if (service_manager_connection_) {
+ std::string process_type_str =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kProcessType);
+ auto process_type = memory_instrumentation::mojom::ProcessType::OTHER;
+ if (process_type_str == switches::kRendererProcess)
+ process_type = memory_instrumentation::mojom::ProcessType::RENDERER;
+ else if (process_type_str == switches::kGpuProcess)
+ process_type = memory_instrumentation::mojom::ProcessType::GPU;
+ else if (process_type_str == switches::kUtilityProcess)
+ process_type = memory_instrumentation::mojom::ProcessType::UTILITY;
+ else if (process_type_str == switches::kPpapiPluginProcess)
+ process_type = memory_instrumentation::mojom::ProcessType::PLUGIN;
+
memory_instrumentation::ProcessLocalDumpManagerImpl::Config config(
- GetConnector(), mojom::kBrowserServiceName);
+ GetConnector(), mojom::kBrowserServiceName, process_type);
memory_instrumentation::ProcessLocalDumpManagerImpl::CreateInstance(
config);
}

Powered by Google App Engine
This is Rietveld 408576698