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

Unified Diff: components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java

Issue 2805743003: Allow posting the CronetEngine UI Thread initialization on a custom Ui executor instead of the defa… (Closed)
Patch Set: Created 3 years, 8 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
Index: components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java
diff --git a/components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java b/components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java
index c7a7cb46b52ed2ece1448634f14f36b89cea496d..2534666d7a2351a842a8fb0d753c77ad000ba350 100644
--- a/components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java
+++ b/components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java
@@ -69,7 +69,11 @@ public class CronetLibraryLoader {
} else {
// The initOnMainThread will complete on the main thread prior
// to other tasks posted to the main thread.
- new Handler(Looper.getMainLooper()).post(task);
+ if (builder.uiExecutor() != null) {
+ builder.uiExecutor().execute(task);
+ } else {
+ new Handler(Looper.getMainLooper()).post(task);
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698