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

Unified Diff: net/spdy/bidirectional_stream_spdy_impl.cc

Issue 2356463002: Implements BidirectionalStreamSpdyImpl::GetLoadTimingInfo (Closed)
Patch Set: Rebased Created 4 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/spdy/bidirectional_stream_spdy_impl.h ('k') | net/spdy/bidirectional_stream_spdy_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/bidirectional_stream_spdy_impl.cc
diff --git a/net/spdy/bidirectional_stream_spdy_impl.cc b/net/spdy/bidirectional_stream_spdy_impl.cc
index 66933a629629f503cf262cf965103b3f75f39a37..8f55edd16adf17d2575955e1469cbdd8bc262f69 100644
--- a/net/spdy/bidirectional_stream_spdy_impl.cc
+++ b/net/spdy/bidirectional_stream_spdy_impl.cc
@@ -38,6 +38,7 @@ BidirectionalStreamSpdyImpl::BidirectionalStreamSpdyImpl(
closed_stream_status_(ERR_FAILED),
closed_stream_received_bytes_(0),
closed_stream_sent_bytes_(0),
+ closed_has_load_timing_info_(false),
weak_factory_(this) {}
BidirectionalStreamSpdyImpl::~BidirectionalStreamSpdyImpl() {
@@ -178,8 +179,19 @@ int64_t BidirectionalStreamSpdyImpl::GetTotalSentBytes() const {
bool BidirectionalStreamSpdyImpl::GetLoadTimingInfo(
LoadTimingInfo* load_timing_info) const {
- // TODO(xunjieli): Implement this crbug.com/648346
- return true;
+ if (stream_closed_) {
+ if (!closed_has_load_timing_info_)
+ return false;
+ *load_timing_info = closed_load_timing_info_;
+ return true;
+ }
+
+ // If |stream_| isn't created or has ID 0, return false. This is to match
+ // the implementation in SpdyHttpStream.
+ if (!stream_ || stream_->stream_id() == 0)
+ return false;
+
+ return stream_->GetLoadTimingInfo(load_timing_info);
}
void BidirectionalStreamSpdyImpl::OnRequestHeadersSent() {
@@ -244,6 +256,8 @@ void BidirectionalStreamSpdyImpl::OnClose(int status) {
closed_stream_status_ = status;
closed_stream_received_bytes_ = stream_->raw_received_bytes();
closed_stream_sent_bytes_ = stream_->raw_sent_bytes();
+ closed_has_load_timing_info_ =
+ stream_->GetLoadTimingInfo(&closed_load_timing_info_);
if (status != OK) {
NotifyError(status);
« no previous file with comments | « net/spdy/bidirectional_stream_spdy_impl.h ('k') | net/spdy/bidirectional_stream_spdy_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698