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

@ -24,6 +24,7 @@
#include "ipc/ipc_buildflags.h"
#include "services/service_manager/embedder/switches.h"
#include "services/service_manager/sandbox/switches.h"
#include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h"
#include "shell/app/atom_content_client.h"
#include "shell/browser/atom_browser_client.h"
#include "shell/browser/atom_gpu_client.h"
@ -182,6 +183,9 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
if (env->HasVar("ELECTRON_DISABLE_SANDBOX"))
command_line->AppendSwitch(service_manager::switches::kNoSandbox);
tracing_sampler_profiler_ =
tracing::TracingSamplerProfiler::CreateOnMainThread();
chrome::RegisterPathProvider();
#if defined(OS_MACOSX)

View file

@ -11,6 +11,10 @@
#include "content/public/app/content_main_delegate.h"
#include "content/public/common/content_client.h"
namespace tracing {
class TracingSamplerProfiler;
}
namespace electron {
void LoadResourceBundle(const std::string& locale);
@ -51,6 +55,7 @@ class AtomMainDelegate : public content::ContentMainDelegate {
std::unique_ptr<content::ContentGpuClient> gpu_client_;
std::unique_ptr<content::ContentRendererClient> renderer_client_;
std::unique_ptr<content::ContentUtilityClient> utility_client_;
std::unique_ptr<tracing::TracingSamplerProfiler> tracing_sampler_profiler_;
DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
};