| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 NET_BASE_UPLOAD_DATA_STREAM_H_ | 5 #ifndef NET_BASE_UPLOAD_DATA_STREAM_H_ |
| 6 #define NET_BASE_UPLOAD_DATA_STREAM_H_ | 6 #define NET_BASE_UPLOAD_DATA_STREAM_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // being read to is not safe for future use, as it may be in use on another | 79 // being read to is not safe for future use, as it may be in use on another |
| 80 // thread. | 80 // thread. |
| 81 void Reset(); | 81 void Reset(); |
| 82 | 82 |
| 83 // Returns true if the upload data in the stream is entirely in memory, and | 83 // Returns true if the upload data in the stream is entirely in memory, and |
| 84 // all read requests will succeed synchronously. Expected to return false for | 84 // all read requests will succeed synchronously. Expected to return false for |
| 85 // chunked requests. | 85 // chunked requests. |
| 86 virtual bool IsInMemory() const; | 86 virtual bool IsInMemory() const; |
| 87 | 87 |
| 88 // Returns a list of element readers owned by |this|, if it has any. | 88 // Returns a list of element readers owned by |this|, if it has any. |
| 89 virtual const ScopedVector<UploadElementReader>* | 89 virtual const ScopedVector<UploadElementReader>* GetElementReaders() const; |
| 90 GetElementReaders() const; | |
| 91 | 90 |
| 92 protected: | 91 protected: |
| 93 // Must be called by subclasses when InitInternal and ReadInternal complete | 92 // Must be called by subclasses when InitInternal and ReadInternal complete |
| 94 // asynchronously. | 93 // asynchronously. |
| 95 void OnInitCompleted(int result); | 94 void OnInitCompleted(int result); |
| 96 void OnReadCompleted(int result); | 95 void OnReadCompleted(int result); |
| 97 | 96 |
| 98 // Must be called before InitInternal completes, for non-chunked uploads. | 97 // Must be called before InitInternal completes, for non-chunked uploads. |
| 99 // Must not be called for chunked uploads. | 98 // Must not be called for chunked uploads. |
| 100 void SetSize(uint64 size); | 99 void SetSize(uint64 size); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 bool is_eof_; | 133 bool is_eof_; |
| 135 | 134 |
| 136 CompletionCallback callback_; | 135 CompletionCallback callback_; |
| 137 | 136 |
| 138 DISALLOW_COPY_AND_ASSIGN(UploadDataStream); | 137 DISALLOW_COPY_AND_ASSIGN(UploadDataStream); |
| 139 }; | 138 }; |
| 140 | 139 |
| 141 } // namespace net | 140 } // namespace net |
| 142 | 141 |
| 143 #endif // NET_BASE_UPLOAD_DATA_STREAM_H_ | 142 #endif // NET_BASE_UPLOAD_DATA_STREAM_H_ |
| OLD | NEW |