| Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
| index 99fb999e82a531c22642077622bc607d40ad8bb4..f2694e7627cb265a30ad6f42815e97692579968c 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
| @@ -233,6 +233,7 @@ public class CustomTabsConnection {
|
| if (!isCallerForegroundOrSelf()) return false;
|
| mClientManager.recordUidHasCalledWarmup(Binder.getCallingUid());
|
| final boolean initialized = !mWarmupHasBeenCalled.compareAndSet(false, true);
|
| + final int uid = Binder.getCallingUid();
|
| // The call is non-blocking and this must execute on the UI thread, post a task.
|
| ThreadUtils.postOnUiThread(new Runnable() {
|
| @Override
|
| @@ -241,6 +242,10 @@ public class CustomTabsConnection {
|
| if (mayCreateSpareWebContents && mSpeculation == null
|
| && !SysUtils.isLowEndDevice()) {
|
| WarmupManager.getInstance().createSpareWebContents();
|
| + // The throttling database uses shared preferences, that can cause a StrictMode
|
| + // violation on the first access. Make sure that this access is not in
|
| + // mayLauchUrl.
|
| + RequestThrottler.getForUid(mApplication, uid);
|
| }
|
| mWarmupHasBeenFinished.set(true);
|
| }
|
|
|