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

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: Addressed comments 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());
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698