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

Side by Side Diff: net/url_request/url_request_http_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_http_job.h ('k') | net/url_request/url_request_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_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 weak_factory_.InvalidateWeakPtrs(); 886 weak_factory_.InvalidateWeakPtrs();
887 DestroyTransaction(); 887 DestroyTransaction();
888 URLRequestJob::Kill(); 888 URLRequestJob::Kill();
889 } 889 }
890 890
891 LoadState URLRequestHttpJob::GetLoadState() const { 891 LoadState URLRequestHttpJob::GetLoadState() const {
892 return transaction_.get() ? 892 return transaction_.get() ?
893 transaction_->GetLoadState() : LOAD_STATE_IDLE; 893 transaction_->GetLoadState() : LOAD_STATE_IDLE;
894 } 894 }
895 895
896 uint64 URLRequestHttpJob::GetUploadProgress() const { 896 UploadProgress URLRequestHttpJob::GetUploadProgress() const {
897 return transaction_.get() ? transaction_->GetUploadProgress().position : 0; 897 return transaction_.get() ?
898 transaction_->GetUploadProgress() : UploadProgress();
898 } 899 }
899 900
900 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const { 901 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const {
901 DCHECK(transaction_.get()); 902 DCHECK(transaction_.get());
902 903
903 if (!response_info_) 904 if (!response_info_)
904 return false; 905 return false;
905 906
906 return GetResponseHeaders()->GetMimeType(mime_type); 907 return GetResponseHeaders()->GetMimeType(mime_type);
907 } 908 }
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 1468
1468 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1469 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1469 awaiting_callback_ = false; 1470 awaiting_callback_ = false;
1470 } 1471 }
1471 1472
1472 void URLRequestHttpJob::OnDetachRequest() { 1473 void URLRequestHttpJob::OnDetachRequest() {
1473 http_transaction_delegate_->OnDetachRequest(); 1474 http_transaction_delegate_->OnDetachRequest();
1474 } 1475 }
1475 1476
1476 } // namespace net 1477 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698