fix: record cpu_profiler data for main process (#21187)

* fix: record cpu_profiler data for main process

* kick ci
This commit is contained in:
Jeremy Apthorp 2019-11-21 18:05:41 -08:00 committed by Shelley Vohr
parent 135a64955c
commit 033d309874
4 changed files with 17 additions and 0 deletions

View file

@ -32,6 +32,7 @@
#include "services/device/public/mojom/constants.mojom.h"
#include "services/network/public/cpp/features.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h"
#include "shell/app/atom_main_delegate.h"
#include "shell/browser/api/atom_api_app.h"
#include "shell/browser/atom_browser_client.h"
@ -389,6 +390,12 @@ int AtomBrowserMainParts::PreCreateThreads() {
return 0;
}
void AtomBrowserMainParts::PostCreateThreads() {
base::PostTask(
FROM_HERE, {content::BrowserThread::IO},
base::BindOnce(&tracing::TracingSamplerProfiler::CreateOnChildThread));
}
void AtomBrowserMainParts::PostDestroyThreads() {
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
extensions_browser_client_.reset();

View file

@ -92,6 +92,7 @@ class AtomBrowserMainParts : public content::BrowserMainParts {
void PostMainMessageLoopStart() override;
void PostMainMessageLoopRun() override;
void PreMainMessageLoopStart() override;
void PostCreateThreads() override;
void PostDestroyThreads() override;
private: