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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 upload_data_stream_.reset( | 295 upload_data_stream_.reset( |
296 new UploadDataStream(UploadDataStream::CHUNKED, 0)); | 296 new UploadDataStream(UploadDataStream::CHUNKED, 0)); |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 void URLRequest::AppendChunkToUpload(const char* bytes, | 300 void URLRequest::AppendChunkToUpload(const char* bytes, |
301 int bytes_len, | 301 int bytes_len, |
302 bool is_last_chunk) { | 302 bool is_last_chunk) { |
303 DCHECK(upload_data_stream_); | 303 DCHECK(upload_data_stream_); |
304 DCHECK(upload_data_stream_->is_chunked()); | 304 DCHECK(upload_data_stream_->is_chunked()); |
305 DCHECK_GT(bytes_len, 0); | 305 // TODO(miloslav) Check whether we could deal with zero-length chunks |
| 306 // DCHECK_GT(bytes_len, 0); |
306 upload_data_stream_->AppendChunk(bytes, bytes_len, is_last_chunk); | 307 upload_data_stream_->AppendChunk(bytes, bytes_len, is_last_chunk); |
307 } | 308 } |
308 | 309 |
309 void URLRequest::set_upload(scoped_ptr<UploadDataStream> upload) { | 310 void URLRequest::set_upload(scoped_ptr<UploadDataStream> upload) { |
310 DCHECK(!upload->is_chunked()); | 311 DCHECK(!upload->is_chunked()); |
311 upload_data_stream_ = upload.Pass(); | 312 upload_data_stream_ = upload.Pass(); |
312 } | 313 } |
313 | 314 |
314 const UploadDataStream* URLRequest::get_upload() const { | 315 const UploadDataStream* URLRequest::get_upload() const { |
315 return upload_data_stream_.get(); | 316 return upload_data_stream_.get(); |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 new base::debug::StackTrace(NULL, 0); | 1233 new base::debug::StackTrace(NULL, 0); |
1233 *stack_trace_copy = stack_trace; | 1234 *stack_trace_copy = stack_trace; |
1234 stack_trace_.reset(stack_trace_copy); | 1235 stack_trace_.reset(stack_trace_copy); |
1235 } | 1236 } |
1236 | 1237 |
1237 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1238 const base::debug::StackTrace* URLRequest::stack_trace() const { |
1238 return stack_trace_.get(); | 1239 return stack_trace_.get(); |
1239 } | 1240 } |
1240 | 1241 |
1241 } // namespace net | 1242 } // namespace net |
OLD | NEW |