| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.net; |
| 6 |
| 7 /** |
| 8 * Interface with callbacks methods for {@link UploadDataProvider}. All methods |
| 9 * may be called synchronously or asynchronously, on any thread. |
| 10 */ |
| 11 public interface UploadDataSink { |
| 12 /** |
| 13 * Called by {@link UploadDataProvider} when a read succeeds. |
| 14 * @param finalChunk For chunked uploads, {@code true} if this is the final |
| 15 * read. It must be {@code false} for non-chunked uploads. |
| 16 */ |
| 17 public void onReadSucceeded(boolean finalChunk); |
| 18 |
| 19 /** |
| 20 * Called by {@link UploadDataProvider} when a read fails. |
| 21 * @param exception Exception passed on to the embedder. |
| 22 */ |
| 23 public void onReadError(Exception exception); |
| 24 |
| 25 /** |
| 26 * Called by {@link UploadDataProvider} when a rewind succeeds. |
| 27 */ |
| 28 public void onRewindSucceeded(); |
| 29 |
| 30 /** |
| 31 * Called by {@link UploadDataProvider} when a rewind fails, or if rewinding |
| 32 * uploads is not supported. |
| 33 * @param exception Exception passed on to the embedder. |
| 34 */ |
| 35 public void onRewindError(Exception exception); |
| 36 } |
| OLD | NEW |