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

Side by Side Diff: net/url_request/url_request.cc

Issue 948503004: [Cronet] Enable chunked upload in CronetUrlRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 (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
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()); 216 // DCHECK(!upload->is_chunked());
xunjieli 2015/02/25 22:11:11 CronetUploadDataStreamAdapter is used for both chu
mmenke 2015/02/25 23:58:24 Yea, just remove this DCHECK.
217 upload_data_stream_ = upload.Pass(); 217 upload_data_stream_ = upload.Pass();
218 } 218 }
219 219
220 const UploadDataStream* URLRequest::get_upload() const { 220 const UploadDataStream* URLRequest::get_upload() const {
221 return upload_data_stream_.get(); 221 return upload_data_stream_.get();
222 } 222 }
223 223
224 bool URLRequest::has_upload() const { 224 bool URLRequest::has_upload() const {
225 return upload_data_stream_.get() != NULL; 225 return upload_data_stream_.get() != NULL;
226 } 226 }
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 new base::debug::StackTrace(NULL, 0); 1191 new base::debug::StackTrace(NULL, 0);
1192 *stack_trace_copy = stack_trace; 1192 *stack_trace_copy = stack_trace;
1193 stack_trace_.reset(stack_trace_copy); 1193 stack_trace_.reset(stack_trace_copy);
1194 } 1194 }
1195 1195
1196 const base::debug::StackTrace* URLRequest::stack_trace() const { 1196 const base::debug::StackTrace* URLRequest::stack_trace() const {
1197 return stack_trace_.get(); 1197 return stack_trace_.get();
1198 } 1198 }
1199 1199
1200 } // namespace net 1200 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698