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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 void URLRequest::AppendChunkToUpload(const char* bytes, | 207 void URLRequest::AppendChunkToUpload(const char* bytes, |
208 int bytes_len, | 208 int bytes_len, |
209 bool is_last_chunk) { | 209 bool is_last_chunk) { |
210 DCHECK(upload_data_stream_); | 210 DCHECK(upload_data_stream_); |
211 DCHECK(upload_data_stream_->is_chunked()); | 211 DCHECK(upload_data_stream_->is_chunked()); |
212 upload_chunked_data_stream_->AppendData(bytes, bytes_len, is_last_chunk); | 212 upload_chunked_data_stream_->AppendData(bytes, bytes_len, is_last_chunk); |
213 } | 213 } |
214 | 214 |
215 void URLRequest::set_upload(scoped_ptr<UploadDataStream> upload) { | 215 void URLRequest::set_upload(scoped_ptr<UploadDataStream> upload) { |
216 DCHECK(!upload->is_chunked()); | |
217 upload_data_stream_ = upload.Pass(); | 216 upload_data_stream_ = upload.Pass(); |
218 } | 217 } |
219 | 218 |
220 const UploadDataStream* URLRequest::get_upload() const { | 219 const UploadDataStream* URLRequest::get_upload() const { |
221 return upload_data_stream_.get(); | 220 return upload_data_stream_.get(); |
222 } | 221 } |
223 | 222 |
224 bool URLRequest::has_upload() const { | 223 bool URLRequest::has_upload() const { |
225 return upload_data_stream_.get() != NULL; | 224 return upload_data_stream_.get() != NULL; |
226 } | 225 } |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 new base::debug::StackTrace(NULL, 0); | 1190 new base::debug::StackTrace(NULL, 0); |
1192 *stack_trace_copy = stack_trace; | 1191 *stack_trace_copy = stack_trace; |
1193 stack_trace_.reset(stack_trace_copy); | 1192 stack_trace_.reset(stack_trace_copy); |
1194 } | 1193 } |
1195 | 1194 |
1196 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1195 const base::debug::StackTrace* URLRequest::stack_trace() const { |
1197 return stack_trace_.get(); | 1196 return stack_trace_.get(); |
1198 } | 1197 } |
1199 | 1198 |
1200 } // namespace net | 1199 } // namespace net |
OLD | NEW |