Commit c8af0e6f authored by Samuel Huang's avatar Samuel Huang Committed by Commit Bot

[DFM] Defer ModuleUtil.recordModuleAvailability() call to onFinishNativeInitialization().

Previously, ModuleUtil.recordModuleAvailability() was called from
ChromeApplication.attachBaseContext(). A side-effect of MU.rMA() is that
it initializes SplitCompat. However, for yet-to-be determined reason,
this early initialization causes failure downstream in
ChromeContentBrowserClient, so that if a DevUI page is loaded as the
active page, restarting Chrome would cause it to fail to load!

This CL alleviates the problem by deferring the MU.rMA() call to
ChromeBrowserInitializer.onFinishNativeInitialization(), thereby
avoiding initializing SplitCompat too early, while still recording
module metrics at start-up.

Bug: 1036753
Change-Id: I21c02dc957f494fb76c959c772a6f77db8b933a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003253Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732158}
parent a8869270
......@@ -117,10 +117,6 @@ public class ChromeApplication extends Application {
ApplicationStatus.registerApplicationStateListener(
ChromeApplication::updateMemoryPressurePolling);
// Record via UMA all modules that have been requested and are currently installed. This
// will tell us the install penetration of each module over time.
ModuleUtil.recordModuleAvailability();
// Set Chrome factory for mapping BackgroundTask classes to TaskIds.
ChromeBackgroundTaskFactory.setAsDefault();
}
......
......@@ -415,6 +415,11 @@ public class ChromeBrowserInitializer {
FeatureUtilities.cacheNativeFlagsForServiceManagerOnlyMode();
ModuleUtil.recordStartupTime();
// Record via UMA all modules that have been requested and are currently installed. This
// will tell us the install penetration of each module over time.
// Side effect: SplitCompat is initialized.
ModuleUtil.recordModuleAvailability();
}
private ActivityStateListener createActivityStateListener() {
......
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