Commit f4867cc4 authored by Tim Volodine's avatar Tim Volodine Committed by Commit Bot

[Android WebView] Make sure to commit any cached metrics.

This ensures that any metrics recorded before the native
library is loaded and intialized are also actually committed.
(e.g. this would ensure that UMA like
Android.WebView.Startup.CreationTime.Stage1.FactoryInit is
properly recorded and available for analysis in dashboard)

BUG=817644

Change-Id: I3067842f34513912b9cd2e6ade91d7fc2aa24b34
Reviewed-on: https://chromium-review.googlesource.com/1061529Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Commit-Queue: Tim Volodine <timvolodine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559518}
parent 7103eb99
......@@ -43,6 +43,7 @@ import org.chromium.base.TraceEvent;
import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.base.metrics.CachedMetrics;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.net.NetworkChangeNotifier;
......@@ -177,6 +178,10 @@ public class WebViewChromiumAwInit {
mStarted = true;
// Make sure to record any cached metrics, now that we know that the native
// library has been loaded and initialized.
CachedMetrics.commitCachedMetrics();
RecordHistogram.recordSparseSlowlyHistogram("Android.WebView.TargetSdkVersion",
context.getApplicationInfo().targetSdkVersion);
......
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