OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/spdy/spdy_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
10 #include "net/spdy/spdy_session.h" | 10 #include "net/spdy/spdy_session.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 int SpdyStream::OnResponseReceived(const spdy::SpdyHeaderBlock& response) { | 82 int SpdyStream::OnResponseReceived(const spdy::SpdyHeaderBlock& response) { |
83 int rv = OK; | 83 int rv = OK; |
84 LOG(INFO) << "OnResponseReceived"; | 84 LOG(INFO) << "OnResponseReceived"; |
85 | 85 |
86 metrics_.StartStream(); | 86 metrics_.StartStream(); |
87 | 87 |
88 DCHECK(response_->empty()); | 88 DCHECK(response_->empty()); |
89 *response_ = response; // TODO(ukai): avoid copy. | 89 *response_ = response; // TODO(ukai): avoid copy. |
90 DCHECK(!response_->empty()); | |
91 | 90 |
92 recv_first_byte_time_ = base::TimeTicks::Now(); | 91 recv_first_byte_time_ = base::TimeTicks::Now(); |
93 response_time_ = base::Time::Now(); | 92 response_time_ = base::Time::Now(); |
94 | 93 |
95 if (io_state_ == STATE_NONE) { | 94 if (io_state_ == STATE_NONE) { |
96 CHECK(pushed_); | 95 CHECK(pushed_); |
97 io_state_ = STATE_READ_HEADERS; | 96 io_state_ = STATE_READ_HEADERS; |
98 } else if (io_state_ == STATE_READ_HEADERS_COMPLETE) { | 97 } else if (io_state_ == STATE_READ_HEADERS_COMPLETE) { |
99 // This SpdyStream could be in this state in both true and false pushed_ | 98 // This SpdyStream could be in this state in both true and false pushed_ |
100 // conditions. | 99 // conditions. |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", | 398 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", |
400 recv_last_byte_time_ - recv_first_byte_time_); | 399 recv_last_byte_time_ - recv_first_byte_time_); |
401 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", | 400 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", |
402 recv_last_byte_time_ - send_time_); | 401 recv_last_byte_time_ - send_time_); |
403 | 402 |
404 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); | 403 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); |
405 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); | 404 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); |
406 } | 405 } |
407 | 406 |
408 } // namespace net | 407 } // namespace net |
OLD | NEW |