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

Unified Diff: net/http/http_cache_transaction.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/http/http_cache_transaction.h ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 85ad67ede6f1d05be19d29ea077ceb3bb500b749..450cc450eebc45ce14a61c59e0b4b301202c4f1b 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -274,6 +274,7 @@ HttpCache::Transaction::Transaction(RequestPriority priority, HttpCache* cache)
write_len_(0),
transaction_pattern_(PATTERN_UNDEFINED),
total_received_bytes_(0),
+ total_sent_bytes_(0),
websocket_handshake_stream_base_create_helper_(NULL),
weak_factory_(this) {
static_assert(HttpCache::Transaction::kNumValidationHeaders ==
@@ -528,6 +529,13 @@ int64 HttpCache::Transaction::GetTotalReceivedBytes() const {
return total_received_bytes;
}
+int64_t HttpCache::Transaction::GetTotalSentBytes() const {
+ int64_t total_sent_bytes = total_sent_bytes_;
+ if (network_trans_)
+ total_sent_bytes += network_trans_->GetTotalSentBytes();
+ return total_sent_bytes;
+}
+
void HttpCache::Transaction::DoneReading() {
if (cache_.get() && entry_) {
DCHECK_NE(mode_, UPDATE);
@@ -2801,6 +2809,7 @@ void HttpCache::Transaction::ResetNetworkTransaction() {
if (network_trans_->GetLoadTimingInfo(&load_timing))
old_network_trans_load_timing_.reset(new LoadTimingInfo(load_timing));
total_received_bytes_ += network_trans_->GetTotalReceivedBytes();
+ total_sent_bytes_ += network_trans_->GetTotalSentBytes();
ConnectionAttempts attempts;
network_trans_->GetConnectionAttempts(&attempts);
for (const auto& attempt : attempts)
« no previous file with comments | « net/http/http_cache_transaction.h ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698