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

Unified Diff: components/cronet/android/api/src/org/chromium/net/CronetEngine.java

Issue 2403053002: [Cronet] Add new API methods before removing old ones (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | components/cronet/android/api/src/org/chromium/net/UrlRequest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35c2a26c099c02adb393240324807f2fb2e659b9..e386b670818795ac45ad4087aafae7d93410e0ff 100644
--- a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
+++ b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
@@ -1154,4 +1154,20 @@ public abstract class CronetEngine {
* @hide it's a prototype.
*/
public abstract void removeRequestFinishedListener(RequestFinishedInfo.Listener listener);
+
+ /**
+ * Creates a builder for {@link UrlRequest}. All callbacks formatted
+ * generated {@link UrlRequest} objects will be invoked on
+ * {@code executor}'s threads. {@code executor} must not run tasks on the
+ * thread calling {@link Executor#execute} to prevent blocking networking
+ * operations and causing exceptions during shutdown.
+ *
+ * @param url URL for the generated requests.
+ * @param callback callback object that gets invoked on different events.
+ * @param executor {@link Executor} on which all callbacks will be invoked.
+ */
+ public UrlRequest.Builder newUrlRequestBuilder(
+ String url, UrlRequest.Callback callback, Executor executor) {
+ return new UrlRequest.Builder(url, callback, executor, this);
+ }
}
« no previous file with comments | « no previous file | components/cronet/android/api/src/org/chromium/net/UrlRequest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698