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

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

Issue 849903002: [Cronet] Upload support for async APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary argument Created 5 years, 10 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/UrlRequest.java
diff --git a/components/cronet/android/java/src/org/chromium/net/UrlRequest.java b/components/cronet/android/java/src/org/chromium/net/UrlRequest.java
index b78dd6313f41db201860790ca8a0e44833cef430..b27388ea9db435cdfa8a1786962bdc9af90114d2 100644
--- a/components/cronet/android/java/src/org/chromium/net/UrlRequest.java
+++ b/components/cronet/android/java/src/org/chromium/net/UrlRequest.java
@@ -4,6 +4,8 @@
package org.chromium.net;
+import java.util.concurrent.Executor;
+
/**
* HTTP request (GET, PUT or POST).
* Note: All methods must be called on the Executor passed in during creation.
@@ -45,6 +47,19 @@ public interface UrlRequest {
public void addHeader(String header, String value);
/**
+ * Sets upload data. Must be done before request has started. May only be
+ * invoked once per request. Switches method to "POST" if not explicitly
+ * set. Starting the request will throw an exception if a Content-Type
+ * header is not set.
+ *
+ * @param uploadDataProvider responsible for providing the upload data.
+ * @param executor All UploadDataProvider methods will be called using this
+ * executor. May optionally be the same executor the request itself is
+ * using.
+ */
+ public void setUploadDataProvider(UploadDataProvider uploadDataProvider, Executor executor);
+
+ /**
* Starts the request, all callbacks go to listener. May only be called
* once. May not be called if cancel has been called on the request.
*/

Powered by Google App Engine
This is Rietveld 408576698