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

Side by Side Diff: net/quic/quic_session.cc

Issue 11364068: Add a QuicHttpStream class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move GetPeerAddress from QuicReliableClientStream to ReliableQuicStream Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/quic/quic_session.h" 5 #include "net/quic/quic_session.h"
6 6
7 #include "net/quic/quic_connection.h" 7 #include "net/quic/quic_connection.h"
8 8
9 using base::StringPiece; 9 using base::StringPiece;
10 using base::hash_map; 10 using base::hash_map;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 DLOG(INFO) << "Closing stream " << stream_id; 91 DLOG(INFO) << "Closing stream " << stream_id;
92 92
93 ReliableStreamMap::iterator it = stream_map_.find(stream_id); 93 ReliableStreamMap::iterator it = stream_map_.find(stream_id);
94 if (it == stream_map_.end()) { 94 if (it == stream_map_.end()) {
95 DLOG(INFO) << "Stream is already closed: " << stream_id; 95 DLOG(INFO) << "Stream is already closed: " << stream_id;
96 return; 96 return;
97 } 97 }
98 stream_map_.erase(it); 98 stream_map_.erase(it);
99 } 99 }
100 100
101 bool QuicSession::IsHandshakeComplete() { 101 bool QuicSession::IsCryptoHandshakeComplete() {
102 return GetCryptoStream()->handshake_complete(); 102 return GetCryptoStream()->handshake_complete();
103 } 103 }
104 104
105 void QuicSession::OnCryptoHandshakeComplete(QuicErrorCode error) {
106 // TODO(rch): tear down the connection if error != QUIC_NO_ERROR.
107 }
108
105 void QuicSession::ActivateStream(ReliableQuicStream* stream) { 109 void QuicSession::ActivateStream(ReliableQuicStream* stream) {
106 LOG(INFO) << "num_streams: " << stream_map_.size() 110 LOG(INFO) << "num_streams: " << stream_map_.size()
107 << ". activating " << stream->id(); 111 << ". activating " << stream->id();
108 DCHECK(stream_map_.count(stream->id()) == 0); 112 DCHECK(stream_map_.count(stream->id()) == 0);
109 stream_map_[stream->id()] = stream; 113 stream_map_[stream->id()] = stream;
110 } 114 }
111 115
112 QuicStreamId QuicSession::GetNextStreamId() { 116 QuicStreamId QuicSession::GetNextStreamId() {
113 QuicStreamId id = next_stream_id_; 117 QuicStreamId id = next_stream_id_;
114 next_stream_id_ += 2; 118 next_stream_id_ += 2;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // streams. 187 // streams.
184 return id <= largest_peer_created_stream_id_ && 188 return id <= largest_peer_created_stream_id_ &&
185 implicitly_created_streams_.count(id) == 0; 189 implicitly_created_streams_.count(id) == 0;
186 } 190 }
187 191
188 size_t QuicSession::GetNumOpenStreams() { 192 size_t QuicSession::GetNumOpenStreams() {
189 return stream_map_.size() + implicitly_created_streams_.size(); 193 return stream_map_.size() + implicitly_created_streams_.size();
190 } 194 }
191 195
192 } // namespace net 196 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698