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

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

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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 // A QuicSession, which demuxes a single connection to individual streams. 5 // A QuicSession, which demuxes a single connection to individual streams.
6 6
7 #ifndef NET_QUIC_QUIC_SESSION_H_ 7 #ifndef NET_QUIC_QUIC_SESSION_H_
8 #define NET_QUIC_QUIC_SESSION_H_ 8 #define NET_QUIC_QUIC_SESSION_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // the server and thus the encryption key has been updated. Therefore the 45 // the server and thus the encryption key has been updated. Therefore the
46 // connection should resend any packets that were sent under 46 // connection should resend any packets that were sent under
47 // ENCRYPTION_INITIAL. (Client only.) 47 // ENCRYPTION_INITIAL. (Client only.)
48 ENCRYPTION_REESTABLISHED, 48 ENCRYPTION_REESTABLISHED,
49 // HANDSHAKE_CONFIRMED, in a client, indicates the the server has accepted 49 // HANDSHAKE_CONFIRMED, in a client, indicates the the server has accepted
50 // our handshake. In a server it indicates that a full, valid client hello 50 // our handshake. In a server it indicates that a full, valid client hello
51 // has been received. (Client and server.) 51 // has been received. (Client and server.)
52 HANDSHAKE_CONFIRMED, 52 HANDSHAKE_CONFIRMED,
53 }; 53 };
54 54
55 QuicSession(QuicConnection* connection, 55 QuicSession(QuicConnection* connection, const QuicConfig& config);
56 const QuicConfig& config);
57 56
58 virtual ~QuicSession(); 57 virtual ~QuicSession();
59 58
60 // QuicConnectionVisitorInterface methods: 59 // QuicConnectionVisitorInterface methods:
61 virtual void OnStreamFrames( 60 virtual void OnStreamFrames(
62 const std::vector<QuicStreamFrame>& frames) OVERRIDE; 61 const std::vector<QuicStreamFrame>& frames) OVERRIDE;
63 virtual void OnRstStream(const QuicRstStreamFrame& frame) OVERRIDE; 62 virtual void OnRstStream(const QuicRstStreamFrame& frame) OVERRIDE;
64 virtual void OnGoAway(const QuicGoAwayFrame& frame) OVERRIDE; 63 virtual void OnGoAway(const QuicGoAwayFrame& frame) OVERRIDE;
65 virtual void OnWindowUpdateFrames( 64 virtual void OnWindowUpdateFrames(
66 const std::vector<QuicWindowUpdateFrame>& frames) OVERRIDE; 65 const std::vector<QuicWindowUpdateFrame>& frames) OVERRIDE;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 QuicConfig* config(); 158 QuicConfig* config();
160 159
161 // Returns true if the stream existed previously and has been closed. 160 // Returns true if the stream existed previously and has been closed.
162 // Returns false if the stream is still active or if the stream has 161 // Returns false if the stream is still active or if the stream has
163 // not yet been created. 162 // not yet been created.
164 bool IsClosedStream(QuicStreamId id); 163 bool IsClosedStream(QuicStreamId id);
165 164
166 QuicConnection* connection() { return connection_.get(); } 165 QuicConnection* connection() { return connection_.get(); }
167 const QuicConnection* connection() const { return connection_.get(); } 166 const QuicConnection* connection() const { return connection_.get(); }
168 size_t num_active_requests() const { return stream_map_.size(); } 167 size_t num_active_requests() const { return stream_map_.size(); }
169 const IPEndPoint& peer_address() const { 168 const IPEndPoint& peer_address() const { return connection_->peer_address(); }
170 return connection_->peer_address();
171 }
172 QuicConnectionId connection_id() const { 169 QuicConnectionId connection_id() const {
173 return connection_->connection_id(); 170 return connection_->connection_id();
174 } 171 }
175 172
176 QuicPacketCreator::Options* options() { return connection()->options(); } 173 QuicPacketCreator::Options* options() { return connection()->options(); }
177 174
178 // Returns the number of currently open streams, including those which have 175 // Returns the number of currently open streams, including those which have
179 // been implicitly created, but excluding the reserved headers and crypto 176 // been implicitly created, but excluding the reserved headers and crypto
180 // streams. 177 // streams.
181 virtual size_t GetNumOpenStreams() const; 178 virtual size_t GetNumOpenStreams() const;
182 179
183 void MarkWriteBlocked(QuicStreamId id, QuicPriority priority); 180 void MarkWriteBlocked(QuicStreamId id, QuicPriority priority);
184 181
185 // Returns true if the session has data to be sent, either queued in the 182 // Returns true if the session has data to be sent, either queued in the
186 // connection, or in a write-blocked stream. 183 // connection, or in a write-blocked stream.
187 bool HasDataToWrite() const; 184 bool HasDataToWrite() const;
188 185
189 bool goaway_received() const { 186 bool goaway_received() const { return goaway_received_; }
190 return goaway_received_;
191 }
192 187
193 bool goaway_sent() const { 188 bool goaway_sent() const { return goaway_sent_; }
194 return goaway_sent_;
195 }
196 189
197 // Gets the SSL connection information. 190 // Gets the SSL connection information.
198 virtual bool GetSSLInfo(SSLInfo* ssl_info) const; 191 virtual bool GetSSLInfo(SSLInfo* ssl_info) const;
199 192
200 QuicErrorCode error() const { return error_; } 193 QuicErrorCode error() const { return error_; }
201 194
202 bool is_server() const { return connection_->is_server(); } 195 bool is_server() const { return connection_->is_server(); }
203 196
204 protected: 197 protected:
205 typedef base::hash_map<QuicStreamId, QuicDataStream*> DataStreamMap; 198 typedef base::hash_map<QuicStreamId, QuicDataStream*> DataStreamMap;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 base::hash_map<QuicStreamId, QuicDataStream*>* streams() { 230 base::hash_map<QuicStreamId, QuicDataStream*>* streams() {
238 return &stream_map_; 231 return &stream_map_;
239 } 232 }
240 233
241 const base::hash_map<QuicStreamId, QuicDataStream*>* streams() const { 234 const base::hash_map<QuicStreamId, QuicDataStream*>* streams() const {
242 return &stream_map_; 235 return &stream_map_;
243 } 236 }
244 237
245 std::vector<QuicDataStream*>* closed_streams() { return &closed_streams_; } 238 std::vector<QuicDataStream*>* closed_streams() { return &closed_streams_; }
246 239
247 size_t get_max_open_streams() const { 240 size_t get_max_open_streams() const { return max_open_streams_; }
248 return max_open_streams_;
249 }
250 241
251 private: 242 private:
252 friend class test::QuicSessionPeer; 243 friend class test::QuicSessionPeer;
253 friend class VisitorShim; 244 friend class VisitorShim;
254 245
255 // Performs the work required to close |stream_id|. If |locally_reset| 246 // Performs the work required to close |stream_id|. If |locally_reset|
256 // then the stream has been reset by this endpoint, not by the peer. 247 // then the stream has been reset by this endpoint, not by the peer.
257 void CloseStreamInner(QuicStreamId stream_id, bool locally_reset); 248 void CloseStreamInner(QuicStreamId stream_id, bool locally_reset);
258 249
259 scoped_ptr<QuicConnection> connection_; 250 scoped_ptr<QuicConnection> connection_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 285
295 // Indicate if there is pending data for the crypto stream. 286 // Indicate if there is pending data for the crypto stream.
296 bool has_pending_handshake_; 287 bool has_pending_handshake_;
297 288
298 DISALLOW_COPY_AND_ASSIGN(QuicSession); 289 DISALLOW_COPY_AND_ASSIGN(QuicSession);
299 }; 290 };
300 291
301 } // namespace net 292 } // namespace net
302 293
303 #endif // NET_QUIC_QUIC_SESSION_H_ 294 #endif // NET_QUIC_QUIC_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698