OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "net/base/file_input_stream.h" | 8 #include "net/base/file_stream.h" |
9 #include "net/base/upload_data.h" | 9 #include "net/base/upload_data.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 class UploadDataStream { | 13 class UploadDataStream { |
14 public: | 14 public: |
15 UploadDataStream(const UploadData* data); | 15 UploadDataStream(const UploadData* data); |
16 ~UploadDataStream(); | 16 ~UploadDataStream(); |
17 | 17 |
18 // Returns the stream's buffer and buffer length. | 18 // Returns the stream's buffer and buffer length. |
(...skipping 27 matching lines...) Expand all Loading... |
46 | 46 |
47 // Iterator to the upload element to be written to the send buffer next. | 47 // Iterator to the upload element to be written to the send buffer next. |
48 std::vector<UploadData::Element>::const_iterator next_element_; | 48 std::vector<UploadData::Element>::const_iterator next_element_; |
49 | 49 |
50 // The byte offset into next_element_'s data buffer if the next element is | 50 // The byte offset into next_element_'s data buffer if the next element is |
51 // a TYPE_BYTES element. | 51 // a TYPE_BYTES element. |
52 size_t next_element_offset_; | 52 size_t next_element_offset_; |
53 | 53 |
54 // A stream to the currently open file, for next_element_ if the next element | 54 // A stream to the currently open file, for next_element_ if the next element |
55 // is a TYPE_FILE element. | 55 // is a TYPE_FILE element. |
56 FileInputStream next_element_stream_; | 56 FileStream next_element_stream_; |
57 | 57 |
58 // The number of bytes remaining to be read from the currently open file | 58 // The number of bytes remaining to be read from the currently open file |
59 // if the next element is of TYPE_FILE. | 59 // if the next element is of TYPE_FILE. |
60 uint64 next_element_remaining_; | 60 uint64 next_element_remaining_; |
61 | 61 |
62 // Size and current read position within the stream. | 62 // Size and current read position within the stream. |
63 uint64 total_size_; | 63 uint64 total_size_; |
64 uint64 current_position_; | 64 uint64 current_position_; |
65 | 65 |
66 DISALLOW_EVIL_CONSTRUCTORS(UploadDataStream); | 66 DISALLOW_EVIL_CONSTRUCTORS(UploadDataStream); |
67 }; | 67 }; |
68 | 68 |
69 } // namespace net | 69 } // namespace net |
70 | 70 |
71 #endif // NET_BASE_UPLOAD_DATA_STREAM_H_ | 71 #endif // NET_BASE_UPLOAD_DATA_STREAM_H_ |
72 | 72 |
OLD | NEW |