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

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

Issue 849903002: [Cronet] Upload support for async APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added throws IOException to UploadDataProvider 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/UploadDataSink.java
diff --git a/components/cronet/android/java/src/org/chromium/net/UploadDataSink.java b/components/cronet/android/java/src/org/chromium/net/UploadDataSink.java
new file mode 100644
index 0000000000000000000000000000000000000000..213ccefe74623f9b0aa3c082854fcf0252ff82d2
--- /dev/null
+++ b/components/cronet/android/java/src/org/chromium/net/UploadDataSink.java
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.net;
+
+/**
+ * Interface with callbacks methods for {@link UploadDataProvider}. All methods
+ * may be called synchronously or asynchronously, on any thread.
+ */
+public interface UploadDataSink {
+ /**
+ * Called by {@link UploadDataProvider} when a read succeeds.
+ * @param finalChunk For chunked uploads, {@code true} if this is the final
+ * read. It must be {@code false} for non-chunked uploads.
+ */
+ public void onReadSucceeded(boolean finalChunk);
+
+ /**
+ * Called by {@link UploadDataProvider} when a read fails.
+ * @param exception Exception passed on to the embedder.
+ */
+ public void onReadError(Exception exception);
+
+ /**
+ * Called by {@link UploadDataProvider} when a rewind succeeds.
+ */
+ public void onRewindSucceeded();
+
+ /**
+ * Called by {@link UploadDataProvider} when a rewind fails, or if rewinding
+ * uploads is not supported.
+ * @param exception Exception passed on to the embedder.
+ */
+ public void onRewindError(Exception exception);
+}

Powered by Google App Engine
This is Rietveld 408576698