OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_ |
| 6 #define NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "net/base/upload_element_reader.h" |
| 10 |
| 11 namespace net { |
| 12 |
| 13 // An UploadElementReader implementation for bytes. |
| 14 class NET_EXPORT_PRIVATE UploadBytesElementReader : public UploadElementReader { |
| 15 public: |
| 16 UploadBytesElementReader(const char* bytes, int bytes_length); |
| 17 virtual ~UploadBytesElementReader(); |
| 18 |
| 19 // UploadElementReader overrides: |
| 20 virtual int InitSync() OVERRIDE; |
| 21 virtual uint64 GetContentLength() const OVERRIDE; |
| 22 virtual uint64 BytesRemaining() const OVERRIDE; |
| 23 virtual int ReadSync(char* buf, int buf_length) OVERRIDE; |
| 24 virtual bool IsInMemory() const OVERRIDE; |
| 25 |
| 26 private: |
| 27 const char* bytes_; |
| 28 int bytes_length_; |
| 29 int offset_; |
| 30 |
| 31 DISALLOW_COPY_AND_ASSIGN(UploadBytesElementReader); |
| 32 }; |
| 33 |
| 34 } // namespace net |
| 35 |
| 36 #endif // NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_ |
OLD | NEW |