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

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

Issue 1327763003: Added and implemented URLRequest::GetTotalSentBytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spdy_sent_bytes_impl
Patch Set: Addressed nits Created 5 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
« no previous file with comments | « net/url_request/url_request.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.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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return job_->GetFullRequestHeaders(headers); 259 return job_->GetFullRequestHeaders(headers);
260 } 260 }
261 261
262 int64 URLRequest::GetTotalReceivedBytes() const { 262 int64 URLRequest::GetTotalReceivedBytes() const {
263 if (!job_.get()) 263 if (!job_.get())
264 return 0; 264 return 0;
265 265
266 return job_->GetTotalReceivedBytes(); 266 return job_->GetTotalReceivedBytes();
267 } 267 }
268 268
269 int64_t URLRequest::GetTotalSentBytes() const {
270 if (!job_.get())
271 return 0;
272
273 return job_->GetTotalSentBytes();
274 }
275
269 LoadStateWithParam URLRequest::GetLoadState() const { 276 LoadStateWithParam URLRequest::GetLoadState() const {
270 // The !blocked_by_.empty() check allows |this| to report it's blocked on a 277 // The !blocked_by_.empty() check allows |this| to report it's blocked on a
271 // delegate before it has been started. 278 // delegate before it has been started.
272 if (calling_delegate_ || !blocked_by_.empty()) { 279 if (calling_delegate_ || !blocked_by_.empty()) {
273 return LoadStateWithParam( 280 return LoadStateWithParam(
274 LOAD_STATE_WAITING_FOR_DELEGATE, 281 LOAD_STATE_WAITING_FOR_DELEGATE,
275 use_blocked_by_as_load_param_ ? base::UTF8ToUTF16(blocked_by_) : 282 use_blocked_by_as_load_param_ ? base::UTF8ToUTF16(blocked_by_) :
276 base::string16()); 283 base::string16());
277 } 284 }
278 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE, 285 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE,
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 } 1193 }
1187 1194
1188 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { 1195 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const {
1189 if (job_) 1196 if (job_)
1190 job_->GetConnectionAttempts(out); 1197 job_->GetConnectionAttempts(out);
1191 else 1198 else
1192 out->clear(); 1199 out->clear();
1193 } 1200 }
1194 1201
1195 } // namespace net 1202 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request.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