Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java

Issue 1465363002: [Storage] Android - ManageSpace UI, Important Origins, and CBD Dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/android/storage_persistance.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java b/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java
index 4f2ec26d024690ef53362752c54f83a76aa6564a..0bdca83e1868f3b299c2b0134784413c4e284256 100644
--- a/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java
+++ b/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java
@@ -6,6 +6,7 @@ package org.chromium.content.browser;
import android.content.Context;
import android.os.Handler;
+import android.os.StrictMode;
import org.chromium.base.Log;
import org.chromium.base.ResourceExtractor;
@@ -292,9 +293,19 @@ public class BrowserStartupController {
ResourceExtractor resourceExtractor = ResourceExtractor.get(mContext);
resourceExtractor.startExtractingResources();
- // Normally Main.java will have already loaded the library asynchronously, we only need
- // to load it here if we arrived via another flow, e.g. bookmark access & sync setup.
- LibraryLoader.get(mLibraryProcessType).ensureInitialized(mContext);
+ // This strictmode exception is to cover the case where the browser process is being started
+ // asynchronously but not in the main browser flow. The main browser flow will trigger
+ // library loading earlier and this will be a no-op, but in the other cases this will need
+ // to block on loading libraries.
+ // This applies to tests and ManageSpaceActivity, which can be launched from Settings.
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
+ try {
+ // Normally Main.java will have already loaded the library asynchronously, we only need
+ // to load it here if we arrived via another flow, e.g. bookmark access & sync setup.
+ LibraryLoader.get(mLibraryProcessType).ensureInitialized(mContext);
+ } finally {
+ StrictMode.setThreadPolicy(oldPolicy);
+ }
Runnable postResourceExtraction = new Runnable() {
@Override
« no previous file with comments | « chrome/test/data/android/storage_persistance.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698