Commit 24351745 authored by Mike Wittman's avatar Mike Wittman Committed by Commit Bot

[Sampling profiler] Delay profiler start post crashpad init

We want to start profiling as early as possible, but also want crash
reporting for this execution.

Also removes the unnecessary ChromeMainDelegate::SandboxInitialized()
overload.

Bug: 1099411
Change-Id: I788cfe5557b5f47cfdabd3c5e03cd045d8f0e037
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2271163Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarEtienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Mike Wittman <wittman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784077}
parent c90a1711
......@@ -33,9 +33,6 @@ ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() = default;
ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() = default;
bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) {
// Start the sampling profiler as early as possible.
sampling_profiler_ = std::make_unique<MainThreadStackSamplingProfiler>();
#if BUILDFLAG(SAFE_BROWSING_DB_REMOTE)
safe_browsing_api_handler_.reset(
new safe_browsing::SafeBrowsingApiHandlerBridge());
......@@ -48,9 +45,11 @@ bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) {
return ChromeMainDelegate::BasicStartupComplete(exit_code);
}
void ChromeMainDelegateAndroid::SandboxInitialized(
const std::string& process_type) {
ChromeMainDelegate::SandboxInitialized(process_type);
void ChromeMainDelegateAndroid::PreSandboxStartup() {
ChromeMainDelegate::PreSandboxStartup();
// Start the sampling profiler after crashpad initialization.
sampling_profiler_ = std::make_unique<MainThreadStackSamplingProfiler>();
}
void ChromeMainDelegateAndroid::SecureDataDirectory() {
......
......@@ -27,7 +27,7 @@ class ChromeMainDelegateAndroid : public ChromeMainDelegate {
~ChromeMainDelegateAndroid() override;
bool BasicStartupComplete(int* exit_code) override;
void SandboxInitialized(const std::string& process_type) override;
void PreSandboxStartup() override;
int RunProcess(
const std::string& process_type,
const content::MainFunctionParams& main_function_params) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment