Chromium Code Reviews| 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 #include "net/url_request/url_request.h" | 5 #include "net/url_request/url_request.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 if (!upload_data_stream_) { | 202 if (!upload_data_stream_) { |
| 203 upload_chunked_data_stream_ = new ChunkedUploadDataStream(0); | 203 upload_chunked_data_stream_ = new ChunkedUploadDataStream(0); |
| 204 upload_data_stream_.reset(upload_chunked_data_stream_); | 204 upload_data_stream_.reset(upload_chunked_data_stream_); |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 void URLRequest::AppendChunkToUpload(const char* bytes, | 208 void URLRequest::AppendChunkToUpload(const char* bytes, |
| 209 int bytes_len, | 209 int bytes_len, |
| 210 bool is_last_chunk) { | 210 bool is_last_chunk) { |
| 211 DCHECK(upload_data_stream_); | 211 DCHECK(upload_data_stream_); |
| 212 DCHECK(upload_data_stream_->is_chunked()); | 212 DCHECK(upload_data_stream_->is_chunked()); |
|
mmenke
2015/02/11 19:43:56
And one quick note...ChunkedUploadDataStream alrea
| |
| 213 DCHECK_GT(bytes_len, 0); | |
| 214 upload_chunked_data_stream_->AppendData(bytes, bytes_len, is_last_chunk); | 213 upload_chunked_data_stream_->AppendData(bytes, bytes_len, is_last_chunk); |
| 215 } | 214 } |
| 216 | 215 |
| 217 void URLRequest::set_upload(scoped_ptr<UploadDataStream> upload) { | 216 void URLRequest::set_upload(scoped_ptr<UploadDataStream> upload) { |
| 218 DCHECK(!upload->is_chunked()); | 217 DCHECK(!upload->is_chunked()); |
| 219 upload_data_stream_ = upload.Pass(); | 218 upload_data_stream_ = upload.Pass(); |
| 220 } | 219 } |
| 221 | 220 |
| 222 const UploadDataStream* URLRequest::get_upload() const { | 221 const UploadDataStream* URLRequest::get_upload() const { |
| 223 return upload_data_stream_.get(); | 222 return upload_data_stream_.get(); |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1198 new base::debug::StackTrace(NULL, 0); | 1197 new base::debug::StackTrace(NULL, 0); |
| 1199 *stack_trace_copy = stack_trace; | 1198 *stack_trace_copy = stack_trace; |
| 1200 stack_trace_.reset(stack_trace_copy); | 1199 stack_trace_.reset(stack_trace_copy); |
| 1201 } | 1200 } |
| 1202 | 1201 |
| 1203 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1202 const base::debug::StackTrace* URLRequest::stack_trace() const { |
| 1204 return stack_trace_.get(); | 1203 return stack_trace_.get(); |
| 1205 } | 1204 } |
| 1206 | 1205 |
| 1207 } // namespace net | 1206 } // namespace net |
| OLD | NEW |