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

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: Combined with Matt's CL Created 5 years, 11 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..7833e764786b0729cc8685617ba808f6e961cf25
--- /dev/null
+++ b/components/cronet/android/java/src/org/chromium/net/UploadDataSink.java
@@ -0,0 +1,36 @@
+// Copyright 2014 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 UploadDataProviders. All methods may
+ * be called synchronously or asynchronously, on any thread.
+ */
+public interface UploadDataSink {
+ /**
+ * Called by UploadDataProvider when a read succeeds.
+ * @param done For chunked uploads, true if this is the final read. Ignored
mef 2015/02/02 17:45:11 @param finalChunk
xunjieli 2015/02/02 18:25:42 Done.
+ * for non-chunked uploads.
pauljensen 2015/02/02 18:11:24 This is not ignored for non-chunked uploads, it in
xunjieli 2015/02/02 18:25:41 Done.
+ */
+ public void onReadSucceeded(boolean finalChunk);
+
+ /**
+ * Called by UploadDataProvider when a read fails.
+ * @param exception Exception passed on to the embedder.
+ */
+ public void onReadError(Exception exception);
+
+ /**
+ * Called by UploadDataProvider when a rewind succeeds.
+ */
+ public void onRewindSucceeded();
+
+ /**
+ * Called by UploadDataProvider when a rewind fails. or if rewiding uploads
mef 2015/02/02 17:45:11 sp: rewinding
xunjieli 2015/02/02 18:25:42 Done.
+ * 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