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

Side by Side Diff: net/base/upload_data.cc

Issue 6357017: Add support for chunked encoding in ChromeFrame for POST requests. This fixes... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/base/upload_data.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/base/upload_data.h" 5 #include "net/base/upload_data.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/file_stream.h" 10 #include "net/base/file_stream.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 elements_.back().SetToChunk(bytes, bytes_len); 152 elements_.back().SetToChunk(bytes, bytes_len);
153 if (chunk_callback_) 153 if (chunk_callback_)
154 chunk_callback_->OnChunkAvailable(); 154 chunk_callback_->OnChunkAvailable();
155 } 155 }
156 156
157 void UploadData::set_chunk_callback(ChunkCallback* callback) { 157 void UploadData::set_chunk_callback(ChunkCallback* callback) {
158 chunk_callback_ = callback; 158 chunk_callback_ = callback;
159 } 159 }
160 160
161 uint64 UploadData::GetContentLength() { 161 uint64 UploadData::GetContentLength() {
162 DCHECK(!is_chunked_);
163 uint64 len = 0; 162 uint64 len = 0;
164 std::vector<Element>::iterator it = elements_.begin(); 163 std::vector<Element>::iterator it = elements_.begin();
165 for (; it != elements_.end(); ++it) 164 for (; it != elements_.end(); ++it)
166 len += (*it).GetContentLength(); 165 len += (*it).GetContentLength();
167 return len; 166 return len;
168 } 167 }
169 168
170 void UploadData::SetElements(const std::vector<Element>& elements) { 169 void UploadData::SetElements(const std::vector<Element>& elements) {
171 elements_ = elements; 170 elements_ = elements;
172 } 171 }
173 172
174 UploadData::~UploadData() { 173 UploadData::~UploadData() {
175 } 174 }
176 175
177 } // namespace net 176 } // namespace net
OLDNEW
« no previous file with comments | « net/base/upload_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698