Commit 62049c0c authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Add metric for call results of ShouldDestroyIncognitoProfileOnStartup.

To audit incognito clean ups at startup,
|Android.ShouldDestroyIncognitoProfileOnStartup| metric is added to
collect the call results to
|IncognitoUtils.shouldDestroyIncognitoProfileOnStartup|.

Bug: 1095548
Change-Id: Ica7aa5228b783a91beb491d6f9aaf07b6cb96bf3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2479466
Auto-Submit: Ramin Halavati <rhalavati@chromium.org>
Commit-Queue: Jesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819355}
parent 31b74663
......@@ -19,6 +19,7 @@ import org.chromium.base.ApplicationStatus;
import org.chromium.base.ContextUtils;
import org.chromium.base.IntentUtils;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.customtabs.CustomTabIncognitoManager;
......@@ -51,6 +52,16 @@ public class IncognitoUtils {
@SuppressLint("NewApi")
public static boolean shouldDestroyIncognitoProfileOnStartup(
boolean selectedTabModelIsIncognito) {
boolean result =
shouldDestroyIncognitoProfileOnStartupInternal(selectedTabModelIsIncognito);
RecordHistogram.recordBooleanHistogram(
"Android.ShouldDestroyIncognitoProfileOnStartup", result);
return result;
}
@SuppressLint("NewApi")
public static boolean shouldDestroyIncognitoProfileOnStartupInternal(
boolean selectedTabModelIsIncognito) {
if (!Profile.getLastUsedRegularProfile().hasOffTheRecordProfile()) {
return false;
}
......
......@@ -1916,6 +1916,17 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="Android.ShouldDestroyIncognitoProfileOnStartup"
units="Boolean" expires_after="M92">
<owner>rhalavati@chromium.org</owner>
<owner>yfriedman@chromium.org</owner>
<summary>
Records the number of times the call to the function
|IncognitoUtils.shouldDestroyIncognitoProfileOnStartup| returns true or
false.
</summary>
</histogram>
<histogram name="Android.StrictMode.OverrideUrlLoadingTime" units="ms"
expires_after="2021-03-28">
<owner>yfriedman@chromium.org</owner>
......
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