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

Unified Diff: chrome/app/chrome_main.cc

Issue 2948283002: Profiling process topology (Closed)
Patch Set: Review comments Created 3 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_main.cc
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc
index 24ba3f62223e0420a29ab447e06cc8092d2e6871..52b2f96b107338644bbef30763bd16b0b1de50d3 100644
--- a/chrome/app/chrome_main.cc
+++ b/chrome/app/chrome_main.cc
@@ -9,6 +9,7 @@
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/app/chrome_main_delegate.h"
+#include "chrome/browser/profiling_host/profiling_process_host.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/features.h"
#include "content/public/app/content_main.h"
@@ -108,12 +109,19 @@ int ChromeMain(int argc, const char** argv) {
#endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
#if BUILDFLAG(ENABLE_OOP_HEAP_PROFILING)
-#if !defined(OS_WIN) || defined(CHROME_MULTIPLE_DLL_BROWSER)
+#if !defined(OS_WIN) || defined(COMPONENT_BUILD) || \
+ defined(CHROME_MULTIPLE_DLL_BROWSER)
// The profiling server is only compiled into the browser process. On Windows,
- // it should be called only for CHROME_MULTIPLE_DLL_BROWSER.
+ // non-component builds, browser code is only used for
+ // CHROME_MULTIPLE_DLL_BROWSER.
if (command_line->HasSwitch(switches::kMemlog))
- return profiling::ProfilingMain(*command_line);
+ profiling::ProfilingProcessHost::EnsureStarted();
#endif
+ // The profiling process. This is a child process type implemented at the
+ // Chrome layer rather than the content layer (like the other child procs.).
+ if (command_line->GetSwitchValueASCII(switches::kProcessType) ==
+ switches::kProfiling)
+ return profiling::ProfilingMain(*command_line);
profiling::InitMemlogSenderIfNecessary(*command_line);
#endif // ENABLE_OOP_HEAP_PROFILING
« no previous file with comments | « no previous file | chrome/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698