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

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: 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
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool HttpBasicStream::IsConnectionReusable() const { 80 bool HttpBasicStream::IsConnectionReusable() const {
81 return parser()->IsConnectionReusable(); 81 return parser()->IsConnectionReusable();
82 } 82 }
83 83
84 int64 HttpBasicStream::GetTotalReceivedBytes() const { 84 int64 HttpBasicStream::GetTotalReceivedBytes() const {
85 if (parser()) 85 if (parser())
86 return parser()->received_bytes(); 86 return parser()->received_bytes();
87 return 0; 87 return 0;
88 } 88 }
89 89
90 int64_t HttpBasicStream::GetTotalSentBytes() const {
91 if (parser())
mmenke 2015/08/31 22:23:13 This check isn't necessary (And while you're here,
sclittle 2015/09/01 01:21:47 This check is needed for GetTotalSent/ReceivedByte
mmenke 2015/09/01 17:39:43 The same can be said of pretty much all these meth
sclittle 2015/09/01 20:03:00 Removing the check from GetTotalReceivedBytes caus
mmenke 2015/09/02 17:36:54 Do you know if it's needed for anything but the DC
sclittle 2015/09/02 18:32:37 I don't know of anything else but that DCHECK, but
92 return parser()->sent_bytes();
93 return 0;
94 }
95
90 bool HttpBasicStream::GetLoadTimingInfo( 96 bool HttpBasicStream::GetLoadTimingInfo(
91 LoadTimingInfo* load_timing_info) const { 97 LoadTimingInfo* load_timing_info) const {
92 return state_.connection()->GetLoadTimingInfo(IsConnectionReused(), 98 return state_.connection()->GetLoadTimingInfo(IsConnectionReused(),
93 load_timing_info); 99 load_timing_info);
94 } 100 }
95 101
96 void HttpBasicStream::GetSSLInfo(SSLInfo* ssl_info) { 102 void HttpBasicStream::GetSSLInfo(SSLInfo* ssl_info) {
97 parser()->GetSSLInfo(ssl_info); 103 parser()->GetSSLInfo(ssl_info);
98 } 104 }
99 105
100 void HttpBasicStream::GetSSLCertRequestInfo( 106 void HttpBasicStream::GetSSLCertRequestInfo(
101 SSLCertRequestInfo* cert_request_info) { 107 SSLCertRequestInfo* cert_request_info) {
102 parser()->GetSSLCertRequestInfo(cert_request_info); 108 parser()->GetSSLCertRequestInfo(cert_request_info);
103 } 109 }
104 110
105 bool HttpBasicStream::IsSpdyHttpStream() const { return false; } 111 bool HttpBasicStream::IsSpdyHttpStream() const { return false; }
106 112
107 void HttpBasicStream::Drain(HttpNetworkSession* session) { 113 void HttpBasicStream::Drain(HttpNetworkSession* session) {
108 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); 114 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this);
109 drainer->Start(session); 115 drainer->Start(session);
110 // |drainer| will delete itself. 116 // |drainer| will delete itself.
111 } 117 }
112 118
113 void HttpBasicStream::SetPriority(RequestPriority priority) { 119 void HttpBasicStream::SetPriority(RequestPriority priority) {
114 // TODO(akalin): Plumb this through to |connection_|. 120 // TODO(akalin): Plumb this through to |connection_|.
115 } 121 }
116 122
117 } // namespace net 123 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698