diff options
author | twifkak <twifkak@chromium.org> | 2015-08-07 13:19:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-07 20:19:39 +0000 |
commit | b2175430067b9063923edab0ac3ae1b986d11d39 (patch) | |
tree | 31706232015d4aa28080940d143a35e0c61e249e /base | |
parent | c953e647cd5955dc11f8f6990676a51a19dba66e (diff) | |
download | chromium_src-b2175430067b9063923edab0ac3ae1b986d11d39.zip chromium_src-b2175430067b9063923edab0ac3ae1b986d11d39.tar.gz chromium_src-b2175430067b9063923edab0ac3ae1b986d11d39.tar.bz2 |
Tweaks to the precache triggering code.
This commit encompasses a few related changes:
1. Enforce that IsPrecachingAllowed is called before IsPrecachingEnabled. This
is so that users are only selected into the field trial if it would have an
effect on them. Calling IsPrecachingEnabled triggers the field trial group
selection, and doing so for users for whom !IsPrecachingAllowed means that our
Enabled population consists of many users for whom precaching won't ultimately
run.
2. Renamed the externally facing methods to ShouldRun and WouldRun, so I could
lean on the compiler to ensure that I addressed all clients, and because
PrecacheManager and PrecacheLauncher were exposing two different notions of
"enabled", which I found confusing.
3. Make updatePrecachingEnabled wait, asynchronously, for the sync backend to
be initialized, before determining what value to pass to setIsPrecachingEnabled.
Previously, DeferredStartupHandler would call
PrecacheLauncher.updatePrecachingEnabled before the sync backend was enabled,
so the is_precaching_enabled pref would be set to false until either
PrivacyPreferences or ConnectionChangeReceiver called updatePrecachingEnabled.
This change should increase the likelihood that precaching will run when the
conditions are right, and decrease the time until that happens.
4. Get rid of the redundant PrivacyPreferencesManager parameter, to simplify
the interface and thus make the implementation more flexible.
5. Change from android.util.Log to org.chromium.base.Log, per presubmit
warning.
BUG=309216
Review URL: https://codereview.chromium.org/1266243003
Cr-Commit-Position: refs/heads/master@{#342427}
Diffstat (limited to 'base')
-rw-r--r-- | base/android/java/src/org/chromium/base/ThreadUtils.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/base/android/java/src/org/chromium/base/ThreadUtils.java b/base/android/java/src/org/chromium/base/ThreadUtils.java index da32552..cf70b71 100644 --- a/base/android/java/src/org/chromium/base/ThreadUtils.java +++ b/base/android/java/src/org/chromium/base/ThreadUtils.java @@ -83,6 +83,7 @@ public class ThreadUtils { * @param c The Callable to run * @return The result of the callable */ + @VisibleForTesting public static <T> T runOnUiThreadBlockingNoException(Callable<T> c) { try { return runOnUiThreadBlocking(c); |