Chromium Code Reviews| Index: components/cronet/android/cronet_upload_data_stream.h |
| diff --git a/components/cronet/android/cronet_upload_data_stream_adapter.h b/components/cronet/android/cronet_upload_data_stream.h |
| similarity index 77% |
| rename from components/cronet/android/cronet_upload_data_stream_adapter.h |
| rename to components/cronet/android/cronet_upload_data_stream.h |
| index ae64314006bc5a7eb53726e5be4c07f5fcbf964d..e4ffe1f4f6827e339377227b28c39f3aa38e0318 100644 |
| --- a/components/cronet/android/cronet_upload_data_stream_adapter.h |
| +++ b/components/cronet/android/cronet_upload_data_stream.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_ADAPTER_H_ |
| -#define COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_ADAPTER_H_ |
| +#ifndef COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_H_ |
| +#define COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_H_ |
| #include "base/basictypes.h" |
| #include "base/macros.h" |
| @@ -17,19 +17,19 @@ class IOBuffer; |
| namespace cronet { |
| -// The CronetUploadDataStreamAdapter is created on a Java thread, but |
| -// afterwards, lives and is deleted on the network thread. It's responsible for |
| -// invoking UploadDataStream's callbacks, and ensuring only one read/rewind |
| -// request sent to Java is outstanding at a time. The main complexity is around |
| -// Reset/Initialize calls while there's a pending read or rewind. |
| -class CronetUploadDataStreamAdapter : public net::UploadDataStream { |
| +// The CronetUploadDataStream is created on a Java thread, but afterwards, lives |
| +// and is deleted on the network thread. It's responsible for ensuring only one |
| +// read/rewind request sent to Java is outstanding at a time. The main |
| +// complexity is around Reset/Initialize calls while there's a pending read or |
| +// rewind. |
| +class CronetUploadDataStream : public net::UploadDataStream { |
| public: |
| class Delegate { |
| public: |
| // Called once during initial setup on the network thread, called before |
| // all other methods. |
| virtual void InitializeOnNetworkThread( |
| - base::WeakPtr<CronetUploadDataStreamAdapter> adapter) = 0; |
| + base::WeakPtr<CronetUploadDataStream> upload_data_Stream) = 0; |
| // Called for each read request. Delegate must respond by calling |
| // OnReadSuccess on the network thread asynchronous, or failing the request. |
| @@ -45,7 +45,7 @@ class CronetUploadDataStreamAdapter : public net::UploadDataStream { |
| // Called when the adapter is destroyed. May be called when there's a |
|
xunjieli
2015/05/08 20:11:27
nit: s/adapter/upload stream.
mmenke
2015/05/08 20:24:18
Done (I actually already got that one, but git cl
|
| // pending read or rewind operation. The Delegate is then responsible for |
| // destroying itself. |
| - virtual void OnAdapterDestroyed() = 0; |
| + virtual void OnUploadDataStreamDestroyed() = 0; |
| protected: |
| Delegate() {} |
| @@ -55,8 +55,8 @@ class CronetUploadDataStreamAdapter : public net::UploadDataStream { |
| DISALLOW_COPY_AND_ASSIGN(Delegate); |
| }; |
| - CronetUploadDataStreamAdapter(Delegate* delegate, int64 size); |
| - ~CronetUploadDataStreamAdapter() override; |
| + CronetUploadDataStream(Delegate* delegate, int64 size); |
| + ~CronetUploadDataStream() override; |
| // Failure is handled at the Java layer. These two success callbacks are |
| // invoked by Java UploadDataSink upon completion of the operation. |
| @@ -101,11 +101,11 @@ class CronetUploadDataStreamAdapter : public net::UploadDataStream { |
| Delegate* const delegate_; |
| // Vends pointers on the network thread, though created on a Java thread. |
| - base::WeakPtrFactory<CronetUploadDataStreamAdapter> weak_factory_; |
| + base::WeakPtrFactory<CronetUploadDataStream> weak_factory_; |
| - DISALLOW_COPY_AND_ASSIGN(CronetUploadDataStreamAdapter); |
| + DISALLOW_COPY_AND_ASSIGN(CronetUploadDataStream); |
| }; |
| } // namespace cronet |
| -#endif // COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_ADAPTER_H_ |
| +#endif // COMPONENTS_CRONET_ANDROID_CRONET_UPLOAD_DATA_STREAM_H_ |