Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: net/base/chunked_upload_data_stream.h

Issue 2351513002: net: rename BoundNetLog to NetLogWithSource (Closed)
Patch Set: one more fix, content bound_net_log_ Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_CHUNKED_UPLOAD_DATA_STREAM_H_ 5 #ifndef NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_
6 #define NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_ 6 #define NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // Adds data to the stream. |is_done| should be true if this is the last 72 // Adds data to the stream. |is_done| should be true if this is the last
73 // data to be appended. |data_len| must not be 0 unless |is_done| is true. 73 // data to be appended. |data_len| must not be 0 unless |is_done| is true.
74 // Once called with |is_done| being true, must never be called again. 74 // Once called with |is_done| being true, must never be called again.
75 // TODO(mmenke): Consider using IOBuffers instead, to reduce data copies. 75 // TODO(mmenke): Consider using IOBuffers instead, to reduce data copies.
76 // TODO(mmenke): Consider making private, and having all consumers use 76 // TODO(mmenke): Consider making private, and having all consumers use
77 // Writers. 77 // Writers.
78 void AppendData(const char* data, int data_len, bool is_done); 78 void AppendData(const char* data, int data_len, bool is_done);
79 79
80 private: 80 private:
81 // UploadDataStream implementation. 81 // UploadDataStream implementation.
82 int InitInternal(const BoundNetLog& net_log) override; 82 int InitInternal(const NetLogWithSource& net_log) override;
83 int ReadInternal(IOBuffer* buf, int buf_len) override; 83 int ReadInternal(IOBuffer* buf, int buf_len) override;
84 void ResetInternal() override; 84 void ResetInternal() override;
85 85
86 int ReadChunk(IOBuffer* buf, int buf_len); 86 int ReadChunk(IOBuffer* buf, int buf_len);
87 87
88 // Index and offset of next element of |upload_data_| to be read. 88 // Index and offset of next element of |upload_data_| to be read.
89 size_t read_index_; 89 size_t read_index_;
90 size_t read_offset_; 90 size_t read_offset_;
91 91
92 // True once all data has been appended to the stream. 92 // True once all data has been appended to the stream.
93 bool all_data_appended_; 93 bool all_data_appended_;
94 94
95 std::vector<std::unique_ptr<std::vector<char>>> upload_data_; 95 std::vector<std::unique_ptr<std::vector<char>>> upload_data_;
96 96
97 // Buffer to write the next read's data to. Only set when a call to 97 // Buffer to write the next read's data to. Only set when a call to
98 // ReadInternal reads no data. 98 // ReadInternal reads no data.
99 scoped_refptr<IOBuffer> read_buffer_; 99 scoped_refptr<IOBuffer> read_buffer_;
100 int read_buffer_len_; 100 int read_buffer_len_;
101 101
102 base::WeakPtrFactory<ChunkedUploadDataStream> weak_factory_; 102 base::WeakPtrFactory<ChunkedUploadDataStream> weak_factory_;
103 103
104 DISALLOW_COPY_AND_ASSIGN(ChunkedUploadDataStream); 104 DISALLOW_COPY_AND_ASSIGN(ChunkedUploadDataStream);
105 }; 105 };
106 106
107 } // namespace net 107 } // namespace net
108 108
109 #endif // NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_ 109 #endif // NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698