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