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

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

Issue 10830182: net: Return size of upload as well as position from URLRequest::GetUploadProgress() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 4 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/url_request/url_request_ftp_job.h ('k') | net/url_request/url_request_http_job.h » ('j') | 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) 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_ftp_job.h" 5 #include "net/url_request/url_request_ftp_job.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "net/base/auth.h" 10 #include "net/base/auth.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 // Once the auth is cancelled, we proceed with the request as though 224 // Once the auth is cancelled, we proceed with the request as though
225 // there were no auth. Schedule this for later so that we don't cause 225 // there were no auth. Schedule this for later so that we don't cause
226 // any recursing into the caller as a result of this call. 226 // any recursing into the caller as a result of this call.
227 MessageLoop::current()->PostTask( 227 MessageLoop::current()->PostTask(
228 FROM_HERE, 228 FROM_HERE,
229 base::Bind(&URLRequestFtpJob::OnStartCompleted, 229 base::Bind(&URLRequestFtpJob::OnStartCompleted,
230 weak_factory_.GetWeakPtr(), OK)); 230 weak_factory_.GetWeakPtr(), OK));
231 } 231 }
232 232
233 uint64 URLRequestFtpJob::GetUploadProgress() const { 233 UploadProgress URLRequestFtpJob::GetUploadProgress() const {
234 return 0; 234 return UploadProgress();
235 } 235 }
236 236
237 bool URLRequestFtpJob::ReadRawData(IOBuffer* buf, 237 bool URLRequestFtpJob::ReadRawData(IOBuffer* buf,
238 int buf_size, 238 int buf_size,
239 int *bytes_read) { 239 int *bytes_read) {
240 DCHECK_NE(buf_size, 0); 240 DCHECK_NE(buf_size, 0);
241 DCHECK(bytes_read); 241 DCHECK(bytes_read);
242 DCHECK(!read_in_progress_); 242 DCHECK(!read_in_progress_);
243 243
244 int rv = transaction_->Read(buf, buf_size, 244 int rv = transaction_->Read(buf, buf_size,
245 base::Bind(&URLRequestFtpJob::OnReadCompleted, 245 base::Bind(&URLRequestFtpJob::OnReadCompleted,
246 base::Unretained(this))); 246 base::Unretained(this)));
247 if (rv >= 0) { 247 if (rv >= 0) {
248 *bytes_read = rv; 248 *bytes_read = rv;
249 return true; 249 return true;
250 } 250 }
251 251
252 if (rv == ERR_IO_PENDING) { 252 if (rv == ERR_IO_PENDING) {
253 read_in_progress_ = true; 253 read_in_progress_ = true;
254 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); 254 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
255 } else { 255 } else {
256 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); 256 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
257 } 257 }
258 return false; 258 return false;
259 } 259 }
260 260
261 } // namespace net 261 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_ftp_job.h ('k') | net/url_request/url_request_http_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698