Commit 0b458e65 authored by Oksana Zhuravlova's avatar Oksana Zhuravlova Committed by Commit Bot

[perf] Add more C++ traces to WebView startup

This change adds more tracing statements to the WebView startup code.

Bug: 1019793
Test: trace output has new blocks
Change-Id: Ic401ace0999f15456d62e69cc13bdabca05241b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2083740Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747573}
parent ee3b6840
...@@ -79,6 +79,7 @@ bool IgnoreOriginSecurityCheck(const GURL& url) { ...@@ -79,6 +79,7 @@ bool IgnoreOriginSecurityCheck(const GURL& url) {
void MigrateProfileData(base::FilePath cache_path, void MigrateProfileData(base::FilePath cache_path,
base::FilePath context_storage_path) { base::FilePath context_storage_path) {
TRACE_EVENT0("startup", "MigrateProfileData");
FilePath old_cache_path; FilePath old_cache_path;
base::PathService::Get(base::DIR_CACHE, &old_cache_path); base::PathService::Get(base::DIR_CACHE, &old_cache_path);
old_cache_path = old_cache_path.DirName().Append( old_cache_path = old_cache_path.DirName().Append(
...@@ -142,6 +143,8 @@ AwBrowserContext::AwBrowserContext() ...@@ -142,6 +143,8 @@ AwBrowserContext::AwBrowserContext()
simple_factory_key_(GetPath(), IsOffTheRecord()) { simple_factory_key_(GetPath(), IsOffTheRecord()) {
DCHECK(!g_browser_context); DCHECK(!g_browser_context);
TRACE_EVENT0("startup", "AwBrowserContext::AwBrowserContext");
if (IsDefaultBrowserContext()) { if (IsDefaultBrowserContext()) {
MigrateProfileData(GetCacheDir(), GetContextStoragePath()); MigrateProfileData(GetCacheDir(), GetContextStoragePath());
} }
...@@ -253,6 +256,7 @@ void AwBrowserContext::RegisterPrefs(PrefRegistrySimple* registry) { ...@@ -253,6 +256,7 @@ void AwBrowserContext::RegisterPrefs(PrefRegistrySimple* registry) {
} }
void AwBrowserContext::CreateUserPrefService() { void AwBrowserContext::CreateUserPrefService() {
TRACE_EVENT0("startup", "AwBrowserContext::CreateUserPrefService");
auto pref_registry = base::MakeRefCounted<user_prefs::PrefRegistrySyncable>(); auto pref_registry = base::MakeRefCounted<user_prefs::PrefRegistrySyncable>();
RegisterPrefs(pref_registry.get()); RegisterPrefs(pref_registry.get());
......
...@@ -121,6 +121,7 @@ int AwBrowserMainParts::PreCreateThreads() { ...@@ -121,6 +121,7 @@ int AwBrowserMainParts::PreCreateThreads() {
} }
void AwBrowserMainParts::PreMainMessageLoopRun() { void AwBrowserMainParts::PreMainMessageLoopRun() {
TRACE_EVENT0("startup", "AwBrowserMainParts::PreMainMessageLoopRun");
AwBrowserProcess::GetInstance()->PreMainMessageLoopRun(); AwBrowserProcess::GetInstance()->PreMainMessageLoopRun();
browser_client_->InitBrowserContext(); browser_client_->InitBrowserContext();
content::WebUIControllerFactory::RegisterFactory( content::WebUIControllerFactory::RegisterFactory(
......
...@@ -75,6 +75,7 @@ AwMainDelegate::AwMainDelegate() = default; ...@@ -75,6 +75,7 @@ AwMainDelegate::AwMainDelegate() = default;
AwMainDelegate::~AwMainDelegate() = default; AwMainDelegate::~AwMainDelegate() = default;
bool AwMainDelegate::BasicStartupComplete(int* exit_code) { bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
TRACE_EVENT0("startup", "AwMainDelegate::BasicStartupComplete");
base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
// WebView uses the Android system's scrollbars and overscroll glow. // WebView uses the Android system's scrollbars and overscroll glow.
...@@ -247,6 +248,7 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) { ...@@ -247,6 +248,7 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
} }
void AwMainDelegate::PreSandboxStartup() { void AwMainDelegate::PreSandboxStartup() {
TRACE_EVENT0("startup", "AwMainDelegate::PreSandboxStartup");
#if defined(ARCH_CPU_ARM_FAMILY) #if defined(ARCH_CPU_ARM_FAMILY)
// Create an instance of the CPU class to parse /proc/cpuinfo and cache // Create an instance of the CPU class to parse /proc/cpuinfo and cache
// cpu_brand info. // cpu_brand info.
......
...@@ -263,6 +263,7 @@ VisitedLinkWriter::~VisitedLinkWriter() { ...@@ -263,6 +263,7 @@ VisitedLinkWriter::~VisitedLinkWriter() {
} }
bool VisitedLinkWriter::Init() { bool VisitedLinkWriter::Init() {
TRACE_EVENT0("browser", "VisitedLinkWriter::Init");
// Create the temporary table. If the table is rebuilt that temporary table // Create the temporary table. If the table is rebuilt that temporary table
// will be became the main table. // will be became the main table.
// The salt must be generated before the table so that it can be copied to // The salt must be generated before the table so that it can be copied to
......
...@@ -735,6 +735,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { ...@@ -735,6 +735,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
// file is available we have to apply it _before_ the main ICU data file. // file is available we have to apply it _before_ the main ICU data file.
// Otherwise, the languages of the extra ICU file will be overridden. // Otherwise, the languages of the extra ICU file will be overridden.
if (process_type.empty()) { if (process_type.empty()) {
TRACE_EVENT0("startup", "InitializeICU");
// In browser process load ICU data files from disk. // In browser process load ICU data files from disk.
if (GetContentClient()->browser()->ShouldLoadExtraIcuDataFile()) { if (GetContentClient()->browser()->ShouldLoadExtraIcuDataFile()) {
if (!base::i18n::InitializeExtraICU()) { if (!base::i18n::InitializeExtraICU()) {
......
...@@ -21,6 +21,7 @@ import org.chromium.base.library_loader.LibraryLoader; ...@@ -21,6 +21,7 @@ import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.base.library_loader.LoaderErrors; import org.chromium.base.library_loader.LoaderErrors;
import org.chromium.base.library_loader.ProcessInitException; import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.base.metrics.ScopedSysTraceEvent;
import org.chromium.base.task.PostTask; import org.chromium.base.task.PostTask;
import org.chromium.content.app.ContentMain; import org.chromium.content.app.ContentMain;
import org.chromium.content.browser.ServicificationStartupUma.ServicificationStartup; import org.chromium.content.browser.ServicificationStartupUma.ServicificationStartup;
...@@ -245,7 +246,10 @@ public class BrowserStartupControllerImpl implements BrowserStartupController { ...@@ -245,7 +246,10 @@ public class BrowserStartupControllerImpl implements BrowserStartupController {
// If already started skip to checking the result // If already started skip to checking the result
if (!mFullBrowserStartupDone) { if (!mFullBrowserStartupDone) {
if (!mHasStartedInitializingBrowserProcess || !mPostResourceExtractionTasksCompleted) { if (!mHasStartedInitializingBrowserProcess || !mPostResourceExtractionTasksCompleted) {
prepareToStartBrowserProcess(singleProcess, null); try (ScopedSysTraceEvent e2 = ScopedSysTraceEvent.scoped(
"BrowserStartupController.prepareToStartBrowserProcess")) {
prepareToStartBrowserProcess(singleProcess, null);
}
} }
boolean startedSuccessfully = true; boolean startedSuccessfully = true;
......
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