OLD | NEW |
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/spdy/spdy_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 int SpdyStream::DoSendHeaders() { | 664 int SpdyStream::DoSendHeaders() { |
665 CHECK(!cancelled_); | 665 CHECK(!cancelled_); |
666 | 666 |
667 SpdyControlFlags flags = CONTROL_FLAG_NONE; | 667 SpdyControlFlags flags = CONTROL_FLAG_NONE; |
668 if (!has_upload_data_) | 668 if (!has_upload_data_) |
669 flags = CONTROL_FLAG_FIN; | 669 flags = CONTROL_FLAG_FIN; |
670 | 670 |
671 CHECK(request_.get()); | 671 CHECK(request_.get()); |
672 int result = session_->WriteSynStream( | 672 int result = session_->WriteSynStream( |
673 stream_id_, priority_, slot_, flags, | 673 stream_id_, priority_, slot_, flags, |
674 request_); | 674 *request_); |
675 if (result != ERR_IO_PENDING) | 675 if (result != ERR_IO_PENDING) |
676 return result; | 676 return result; |
677 | 677 |
678 send_time_ = base::TimeTicks::Now(); | 678 send_time_ = base::TimeTicks::Now(); |
679 io_state_ = STATE_SEND_HEADERS_COMPLETE; | 679 io_state_ = STATE_SEND_HEADERS_COMPLETE; |
680 return ERR_IO_PENDING; | 680 return ERR_IO_PENDING; |
681 } | 681 } |
682 | 682 |
683 int SpdyStream::DoSendHeadersComplete(int result) { | 683 int SpdyStream::DoSendHeadersComplete(int result) { |
684 if (result < 0) | 684 if (result < 0) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", | 748 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", |
749 recv_last_byte_time_ - recv_first_byte_time_); | 749 recv_last_byte_time_ - recv_first_byte_time_); |
750 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", | 750 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", |
751 recv_last_byte_time_ - send_time_); | 751 recv_last_byte_time_ - send_time_); |
752 | 752 |
753 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); | 753 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); |
754 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); | 754 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); |
755 } | 755 } |
756 | 756 |
757 } // namespace net | 757 } // namespace net |
OLD | NEW |