Commit 3c6ce541 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles) Committed by Commit Bot

webview: remove obsolete data dir lock metrics.

The retry behaviour of the WebView data directory lock is now
well-understood and we're not going to change the code any further;
remove the retry count metric.

Also remove the metric logging when init has already been started
previously - this has shown that a very small number of apps are
actually hitting this case and only in a very tiny percentage of cases.
Just remove the metric and don't introduce any new check for this
condition; these apps will either work or not and it's not worth us
worrying about it.

Fixed: 1142488
Change-Id: I90b85e999ca74ebecdc66c2ac7e11aa4b0bf1d2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2498110
Auto-Submit: Richard Coles <torne@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarCaitlin Fischer <caitlinfischer@google.com>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Commit-Queue: Ilya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823305}
parent 68c45c59
......@@ -104,9 +104,6 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
private static WebViewChromiumFactoryProvider sSingleton;
// Used to indicate if WebLayer and WebView are running in the same process.
private static boolean sWebLayerRunningInSameProcess;
// Used to detect if we enter initialization for a second time, e.g. because an app caught and
// discarded an exception thrown by a previous failed initialization attempt.
private static volatile boolean sInitAlreadyStarted;
private final WebViewChromiumRunQueue mRunQueue = new WebViewChromiumRunQueue(
() -> { return WebViewChromiumFactoryProvider.this.mAwInit.hasStarted(); });
......@@ -248,10 +245,6 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
long startTime = SystemClock.elapsedRealtime();
try (ScopedSysTraceEvent e1 =
ScopedSysTraceEvent.scoped("WebViewChromiumFactoryProvider.initialize")) {
RecordHistogram.recordBooleanHistogram(
"Android.WebView.Startup.InitAlreadyStarted", sInitAlreadyStarted);
sInitAlreadyStarted = true;
PackageInfo packageInfo;
try (ScopedSysTraceEvent e2 = ScopedSysTraceEvent.scoped(
"WebViewChromiumFactoryProvider.getLoadedPackageInfo")) {
......
......@@ -15,7 +15,6 @@ import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.PathUtils;
import org.chromium.base.StrictModeContext;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.ScopedSysTraceEvent;
import java.io.File;
......@@ -86,7 +85,6 @@ abstract class AwDataDirLock {
if (sExclusiveFileLock != null) {
// We got the lock; write out info for debugging.
writeCurrentProcessInfo(sLockFile);
recordLockAttempts(attempts);
return;
}
......@@ -108,8 +106,6 @@ abstract class AwDataDirLock {
throw new RuntimeException(error);
} else {
Log.w(TAG, error);
// Record an attempt count of 0 to indicate that we proceeded without the lock.
recordLockAttempts(0);
}
}
}
......@@ -126,14 +122,6 @@ abstract class AwDataDirLock {
}
}
private static void recordLockAttempts(int attempts) {
// We log values from [0, LOCK_RETRIES]. Histogram samples are expected to be [0, max).
// 0 just goes to the underflow bucket, so min=1 and max=LOCK_RETRIES+1.
// To get bucket width 1, buckets must be max-min+2
RecordHistogram.recordLinearCountHistogram("Android.WebView.Startup.DataDirLockAttempts",
attempts, 1, LOCK_RETRIES + 1, LOCK_RETRIES + 2);
}
private static String getLockFailureReason(final RandomAccessFile file) {
final StringBuilder error = new StringBuilder("Using WebView from more than one process at "
+ "once with the same data directory is not supported. https://crbug.com/558377 "
......
......@@ -2652,6 +2652,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Android.WebView.Startup.DataDirLockAttempts" units="attempts"
expires_after="2020-12-10">
<obsolete>
Removed 2020-10
</obsolete>
<owner>torne@chromium.org</owner>
<owner>src/android_webview/OWNERS</owner>
<summary>
......@@ -2663,6 +2666,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Android.WebView.Startup.InitAlreadyStarted" enum="Boolean"
expires_after="2020-12-10">
<obsolete>
Removed 2020-10
</obsolete>
<owner>torne@chromium.org</owner>
<owner>src/android_webview/OWNERS</owner>
<summary>
......
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