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

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

Issue 10834178: net: Return size of upload as well as position from HttpTransaction::GetUploadProgress() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make UploadProgress a class instead of a struct Created 8 years, 3 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
« net/base/upload_progress.h ('K') | « net/spdy/spdy_http_stream.cc ('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) 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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 DestroyTransaction(); 1015 DestroyTransaction();
1016 URLRequestJob::Kill(); 1016 URLRequestJob::Kill();
1017 } 1017 }
1018 1018
1019 LoadState URLRequestHttpJob::GetLoadState() const { 1019 LoadState URLRequestHttpJob::GetLoadState() const {
1020 return transaction_.get() ? 1020 return transaction_.get() ?
1021 transaction_->GetLoadState() : LOAD_STATE_IDLE; 1021 transaction_->GetLoadState() : LOAD_STATE_IDLE;
1022 } 1022 }
1023 1023
1024 uint64 URLRequestHttpJob::GetUploadProgress() const { 1024 uint64 URLRequestHttpJob::GetUploadProgress() const {
1025 return transaction_.get() ? transaction_->GetUploadProgress() : 0; 1025 return transaction_.get() ? transaction_->GetUploadProgress().position() : 0;
1026 } 1026 }
1027 1027
1028 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const { 1028 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const {
1029 DCHECK(transaction_.get()); 1029 DCHECK(transaction_.get());
1030 1030
1031 if (!response_info_) 1031 if (!response_info_)
1032 return false; 1032 return false;
1033 1033
1034 return GetResponseHeaders()->GetMimeType(mime_type); 1034 return GetResponseHeaders()->GetMimeType(mime_type);
1035 } 1035 }
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 1627
1628 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1628 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1629 awaiting_callback_ = false; 1629 awaiting_callback_ = false;
1630 } 1630 }
1631 1631
1632 void URLRequestHttpJob::OnDetachRequest() { 1632 void URLRequestHttpJob::OnDetachRequest() {
1633 http_transaction_delegate_->OnDetachRequest(); 1633 http_transaction_delegate_->OnDetachRequest();
1634 } 1634 }
1635 1635
1636 } // namespace net 1636 } // namespace net
OLDNEW
« net/base/upload_progress.h ('K') | « net/spdy/spdy_http_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698