| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/quic/quic_spdy_session.h" | 5 #include "net/quic/quic_spdy_session.h" |
| 6 | 6 |
| 7 #include "net/quic/quic_headers_stream.h" | 7 #include "net/quic/quic_headers_stream.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| 11 QuicSpdySession::QuicSpdySession(QuicConnection* connection, | 11 QuicSpdySession::QuicSpdySession(QuicConnection* connection, |
| 12 const QuicConfig& config) | 12 const QuicConfig& config) |
| 13 : QuicSession(connection, config) { | 13 : QuicSession(connection, config) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 QuicSpdySession::~QuicSpdySession() { | 16 QuicSpdySession::~QuicSpdySession() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 void QuicSpdySession::Initialize() { | 19 void QuicSpdySession::Initialize() { |
| 20 QuicSession::Initialize(); | 20 QuicSession::Initialize(); |
| 21 | 21 |
| 22 if (perspective() == Perspective::IS_SERVER) { | 22 if (perspective() == Perspective::IS_SERVER) { |
| 23 set_largest_peer_created_stream_id(kHeadersStreamId); | 23 set_largest_peer_created_stream_id(kHeadersStreamId); |
| 24 } else { | 24 } else { |
| 25 QuicStreamId headers_stream_id = GetNextStreamId(); | 25 QuicStreamId headers_stream_id = GetNextOutgoingStreamId(); |
| 26 DCHECK_EQ(headers_stream_id, kHeadersStreamId); | 26 DCHECK_EQ(headers_stream_id, kHeadersStreamId); |
| 27 } | 27 } |
| 28 | 28 |
| 29 headers_stream_.reset(new QuicHeadersStream(this)); | 29 headers_stream_.reset(new QuicHeadersStream(this)); |
| 30 DCHECK_EQ(kHeadersStreamId, headers_stream_->id()); | 30 DCHECK_EQ(kHeadersStreamId, headers_stream_->id()); |
| 31 static_streams()[kHeadersStreamId] = headers_stream_.get(); | 31 static_streams()[kHeadersStreamId] = headers_stream_.get(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void QuicSpdySession::OnStreamHeaders(QuicStreamId stream_id, | 34 void QuicSpdySession::OnStreamHeaders(QuicStreamId stream_id, |
| 35 StringPiece headers_data) { | 35 StringPiece headers_data) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 return headers_stream_->WriteHeaders(id, headers, fin, priority, | 71 return headers_stream_->WriteHeaders(id, headers, fin, priority, |
| 72 ack_notifier_delegate); | 72 ack_notifier_delegate); |
| 73 } | 73 } |
| 74 | 74 |
| 75 QuicSpdyStream* QuicSpdySession::GetSpdyDataStream( | 75 QuicSpdyStream* QuicSpdySession::GetSpdyDataStream( |
| 76 const QuicStreamId stream_id) { | 76 const QuicStreamId stream_id) { |
| 77 return static_cast<QuicSpdyStream*>(GetDynamicStream(stream_id)); | 77 return static_cast<QuicSpdyStream*>(GetDynamicStream(stream_id)); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace net | 80 } // namespace net |
| OLD | NEW |