| 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 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_H_ | 5 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_H_ |
| 6 #define COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_H_ | 6 #define COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 CronetUploadDataStream(Delegate* delegate, int64_t size); | 60 CronetUploadDataStream(Delegate* delegate, int64_t size); |
| 61 ~CronetUploadDataStream() override; | 61 ~CronetUploadDataStream() override; |
| 62 | 62 |
| 63 // Failure is handled at the Java layer. These two success callbacks are | 63 // Failure is handled at the Java layer. These two success callbacks are |
| 64 // invoked by Java UploadDataSink upon completion of the operation. | 64 // invoked by Java UploadDataSink upon completion of the operation. |
| 65 void OnReadSuccess(int bytes_read, bool final_chunk); | 65 void OnReadSuccess(int bytes_read, bool final_chunk); |
| 66 void OnRewindSuccess(); | 66 void OnRewindSuccess(); |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 // net::UploadDataStream implementation: | 69 // net::UploadDataStream implementation: |
| 70 int InitInternal(const net::BoundNetLog& net_log) override; | 70 int InitInternal(const net::NetLogWithSource& net_log) override; |
| 71 int ReadInternal(net::IOBuffer* buf, int buf_len) override; | 71 int ReadInternal(net::IOBuffer* buf, int buf_len) override; |
| 72 void ResetInternal() override; | 72 void ResetInternal() override; |
| 73 | 73 |
| 74 // Starts rewinding the stream. Only called when not already at the front of | 74 // Starts rewinding the stream. Only called when not already at the front of |
| 75 // the stream, and no operation is pending. Completes asynchronously. | 75 // the stream, and no operation is pending. Completes asynchronously. |
| 76 void StartRewind(); | 76 void StartRewind(); |
| 77 | 77 |
| 78 // Size of the upload. -1 if chunked. | 78 // Size of the upload. -1 if chunked. |
| 79 const int64_t size_; | 79 const int64_t size_; |
| 80 | 80 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 104 | 104 |
| 105 // Vends pointers on the network thread, though created on a Java thread. | 105 // Vends pointers on the network thread, though created on a Java thread. |
| 106 base::WeakPtrFactory<CronetUploadDataStream> weak_factory_; | 106 base::WeakPtrFactory<CronetUploadDataStream> weak_factory_; |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(CronetUploadDataStream); | 108 DISALLOW_COPY_AND_ASSIGN(CronetUploadDataStream); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace cronet | 111 } // namespace cronet |
| 112 | 112 |
| 113 #endif // COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_H_ | 113 #endif // COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_H_ |
| OLD | NEW |