| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 DCHECK(response_received()); | 512 DCHECK(response_received()); |
| 513 return ERR_IO_PENDING; | 513 return ERR_IO_PENDING; |
| 514 } | 514 } |
| 515 CHECK_EQ(STATE_NONE, io_state_); | 515 CHECK_EQ(STATE_NONE, io_state_); |
| 516 io_state_ = STATE_GET_DOMAIN_BOUND_CERT; | 516 io_state_ = STATE_GET_DOMAIN_BOUND_CERT; |
| 517 return DoLoop(OK); | 517 return DoLoop(OK); |
| 518 } | 518 } |
| 519 | 519 |
| 520 int SpdyStream::WriteStreamData(IOBuffer* data, int length, | 520 int SpdyStream::WriteStreamData(IOBuffer* data, int length, |
| 521 SpdyDataFlags flags) { | 521 SpdyDataFlags flags) { |
| 522 // Until the headers have been completely sent, we can not be sure |
| 523 // that our stream_id is correct. |
| 524 DCHECK_GT(io_state_, STATE_SEND_HEADERS_COMPLETE); |
| 522 return session_->WriteStreamData(stream_id_, data, length, flags); | 525 return session_->WriteStreamData(stream_id_, data, length, flags); |
| 523 } | 526 } |
| 524 | 527 |
| 525 bool SpdyStream::GetSSLInfo(SSLInfo* ssl_info, | 528 bool SpdyStream::GetSSLInfo(SSLInfo* ssl_info, |
| 526 bool* was_npn_negotiated, | 529 bool* was_npn_negotiated, |
| 527 NextProto* protocol_negotiated) { | 530 NextProto* protocol_negotiated) { |
| 528 return session_->GetSSLInfo( | 531 return session_->GetSSLInfo( |
| 529 ssl_info, was_npn_negotiated, protocol_negotiated); | 532 ssl_info, was_npn_negotiated, protocol_negotiated); |
| 530 } | 533 } |
| 531 | 534 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", | 771 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", |
| 769 recv_last_byte_time_ - recv_first_byte_time_); | 772 recv_last_byte_time_ - recv_first_byte_time_); |
| 770 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", | 773 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", |
| 771 recv_last_byte_time_ - send_time_); | 774 recv_last_byte_time_ - send_time_); |
| 772 | 775 |
| 773 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); | 776 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); |
| 774 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); | 777 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); |
| 775 } | 778 } |
| 776 | 779 |
| 777 } // namespace net | 780 } // namespace net |
| OLD | NEW |