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

Side by Side Diff: net/http/http_basic_stream.cc

Issue 1314783007: Added and implemented HttpStream::GetTotalSentBytes for basic streams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on master 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/http/http_basic_stream.h ('k') | net/http/http_network_transaction_unittest.cc » ('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/http/http_basic_stream.h" 5 #include "net/http/http_basic_stream.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "net/http/http_request_info.h" 8 #include "net/http/http_request_info.h"
9 #include "net/http/http_response_body_drainer.h" 9 #include "net/http/http_response_body_drainer.h"
10 #include "net/http/http_stream_parser.h" 10 #include "net/http/http_stream_parser.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 bool HttpBasicStream::CanReuseConnection() const { 76 bool HttpBasicStream::CanReuseConnection() const {
77 return parser()->CanReuseConnection(); 77 return parser()->CanReuseConnection();
78 } 78 }
79 79
80 int64 HttpBasicStream::GetTotalReceivedBytes() const { 80 int64 HttpBasicStream::GetTotalReceivedBytes() const {
81 if (parser()) 81 if (parser())
82 return parser()->received_bytes(); 82 return parser()->received_bytes();
83 return 0; 83 return 0;
84 } 84 }
85 85
86 int64_t HttpBasicStream::GetTotalSentBytes() const {
87 if (parser())
88 return parser()->sent_bytes();
89 return 0;
90 }
91
86 bool HttpBasicStream::GetLoadTimingInfo( 92 bool HttpBasicStream::GetLoadTimingInfo(
87 LoadTimingInfo* load_timing_info) const { 93 LoadTimingInfo* load_timing_info) const {
88 return state_.connection()->GetLoadTimingInfo(IsConnectionReused(), 94 return state_.connection()->GetLoadTimingInfo(IsConnectionReused(),
89 load_timing_info); 95 load_timing_info);
90 } 96 }
91 97
92 void HttpBasicStream::GetSSLInfo(SSLInfo* ssl_info) { 98 void HttpBasicStream::GetSSLInfo(SSLInfo* ssl_info) {
93 parser()->GetSSLInfo(ssl_info); 99 parser()->GetSSLInfo(ssl_info);
94 } 100 }
95 101
96 void HttpBasicStream::GetSSLCertRequestInfo( 102 void HttpBasicStream::GetSSLCertRequestInfo(
97 SSLCertRequestInfo* cert_request_info) { 103 SSLCertRequestInfo* cert_request_info) {
98 parser()->GetSSLCertRequestInfo(cert_request_info); 104 parser()->GetSSLCertRequestInfo(cert_request_info);
99 } 105 }
100 106
101 void HttpBasicStream::Drain(HttpNetworkSession* session) { 107 void HttpBasicStream::Drain(HttpNetworkSession* session) {
102 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); 108 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this);
103 drainer->Start(session); 109 drainer->Start(session);
104 // |drainer| will delete itself. 110 // |drainer| will delete itself.
105 } 111 }
106 112
107 void HttpBasicStream::SetPriority(RequestPriority priority) { 113 void HttpBasicStream::SetPriority(RequestPriority priority) {
108 // TODO(akalin): Plumb this through to |connection_|. 114 // TODO(akalin): Plumb this through to |connection_|.
109 } 115 }
110 116
111 } // namespace net 117 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_basic_stream.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698