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

Unified Diff: net/url_request/url_request_http_job.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_http_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 982971edbcd7c397c66e6c0524da4fee314edab6..2937478109334fc4a467408a1fcf596b3d33f954 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -198,6 +198,7 @@ URLRequestHttpJob::URLRequestHttpJob(
http_user_agent_settings_(http_user_agent_settings),
backoff_manager_(request->context()->backoff_manager()),
total_received_bytes_from_previous_transactions_(0),
+ total_sent_bytes_from_previous_transactions_(0),
weak_factory_(this) {
URLRequestThrottlerManager* manager = request->context()->throttler_manager();
if (manager)
@@ -425,6 +426,8 @@ void URLRequestHttpJob::DestroyTransaction() {
total_received_bytes_from_previous_transactions_ +=
transaction_->GetTotalReceivedBytes();
+ total_sent_bytes_from_previous_transactions_ +=
+ transaction_->GetTotalSentBytes();
transaction_.reset();
response_info_ = NULL;
receive_headers_end_ = base::TimeTicks();
@@ -1370,6 +1373,13 @@ int64 URLRequestHttpJob::GetTotalReceivedBytes() const {
return total_received_bytes;
}
+int64_t URLRequestHttpJob::GetTotalSentBytes() const {
+ int64_t total_sent_bytes = total_sent_bytes_from_previous_transactions_;
+ if (transaction_)
+ total_sent_bytes += transaction_->GetTotalSentBytes();
+ return total_sent_bytes;
+}
+
void URLRequestHttpJob::DoneReading() {
if (transaction_) {
transaction_->DoneReading();
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_http_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698