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

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: Addressed Misha's comments 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 54b72a195286a99ee0c9776613e7b6acd2171654..8906ee2906f3db7e60eec7aef4fd3808a00226ba 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
pauljensen 2015/02/12 17:15:40 I think UploadDataProvider should not have the fir
xunjieli 2015/02/12 20:56:28 Done.
+ * executor. May optionally be the same executor the request itself is
pauljensen 2015/02/12 17:15:40 I think both copies of "executor" on this line sho
xunjieli 2015/02/12 20:56:28 Done.
+ * 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