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

Unified Diff: components/cronet/android/api/src/org/chromium/net/CronetEngine.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/api/src/org/chromium/net/CronetEngine.java
diff --git a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
index 629adfaef31bcd5741e7ed8f9073fdba8b3a0f18..5f513f4df7e39252c3af943032d79c11d811854a 100644
--- a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
+++ b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
@@ -136,6 +136,18 @@ public abstract class CronetEngine {
}
/**
+ * Sets an {@link Executor} to be used for initialization code that needs to run
+ * on the Ui Thread.
+ * If not set, the library will be use the {@link android.os.Looper#getMainLooper()}.
+ * @param uiExecutor {@code Executor} to be used for the initialization.
+ * @return the builder to facilitate chaining.
+ */
+ public Builder setUiThreadExecutor(Executor uiExecutor) {
+ mBuilderDelegate.setUiThreadExecutor(uiExecutor);
+ return this;
+ }
+
+ /**
* Sets whether <a href="https://www.chromium.org/quic">QUIC</a> protocol
* is enabled. Defaults to disabled. If QUIC is enabled, then QUIC User Agent Id
* containing application name and Cronet version is sent to the server.
« no previous file with comments | « components/cronet/android/api.txt ('k') | components/cronet/android/api/src/org/chromium/net/ExperimentalCronetEngine.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698