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 // A client specific QuicSession subclass. This class owns the underlying | 5 // A client specific QuicSession subclass. This class owns the underlying |
6 // QuicConnection and QuicConnectionHelper objects. The connection stores | 6 // QuicConnection and QuicConnectionHelper objects. The connection stores |
7 // a non-owning pointer to the helper so this session needs to ensure that | 7 // a non-owning pointer to the helper so this session needs to ensure that |
8 // the helper outlives the connection. | 8 // the helper outlives the connection. |
9 | 9 |
10 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_H_ | 10 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_H_ |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // TODO(rch): remove |stream| from this and use setter on |request| | 118 // TODO(rch): remove |stream| from this and use setter on |request| |
119 // and fix in spdy too. | 119 // and fix in spdy too. |
120 int TryCreateStream(StreamRequest* request, | 120 int TryCreateStream(StreamRequest* request, |
121 QuicReliableClientStream** stream); | 121 QuicReliableClientStream** stream); |
122 | 122 |
123 // Cancels the pending stream creation request. | 123 // Cancels the pending stream creation request. |
124 void CancelRequest(StreamRequest* request); | 124 void CancelRequest(StreamRequest* request); |
125 | 125 |
126 // QuicSession methods: | 126 // QuicSession methods: |
127 void OnStreamFrames(const std::vector<QuicStreamFrame>& frames) override; | 127 void OnStreamFrames(const std::vector<QuicStreamFrame>& frames) override; |
128 QuicReliableClientStream* CreateOutgoingDataStream() override; | 128 QuicReliableClientStream* CreateOutgoingDynamicStream() override; |
129 QuicCryptoClientStream* GetCryptoStream() override; | 129 QuicCryptoClientStream* GetCryptoStream() override; |
130 void CloseStream(QuicStreamId stream_id) override; | 130 void CloseStream(QuicStreamId stream_id) override; |
131 void SendRstStream(QuicStreamId id, | 131 void SendRstStream(QuicStreamId id, |
132 QuicRstStreamErrorCode error, | 132 QuicRstStreamErrorCode error, |
133 QuicStreamOffset bytes_written) override; | 133 QuicStreamOffset bytes_written) override; |
134 void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override; | 134 void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override; |
135 void OnCryptoHandshakeMessageSent( | 135 void OnCryptoHandshakeMessageSent( |
136 const CryptoHandshakeMessage& message) override; | 136 const CryptoHandshakeMessage& message) override; |
137 void OnCryptoHandshakeMessageReceived( | 137 void OnCryptoHandshakeMessageReceived( |
138 const CryptoHandshakeMessage& message) override; | 138 const CryptoHandshakeMessage& message) override; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 // Returns true if |hostname| may be pooled onto this session. If this | 189 // Returns true if |hostname| may be pooled onto this session. If this |
190 // is a secure QUIC session, then |hostname| must match the certificate | 190 // is a secure QUIC session, then |hostname| must match the certificate |
191 // presented during the handshake. | 191 // presented during the handshake. |
192 bool CanPool(const std::string& hostname, PrivacyMode privacy_mode) const; | 192 bool CanPool(const std::string& hostname, PrivacyMode privacy_mode) const; |
193 | 193 |
194 const QuicServerId& server_id() const { return server_id_; } | 194 const QuicServerId& server_id() const { return server_id_; } |
195 | 195 |
196 protected: | 196 protected: |
197 // QuicSession methods: | 197 // QuicSession methods: |
198 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; | 198 QuicDataStream* CreateIncomingDynamicStream(QuicStreamId id) override; |
199 | 199 |
200 private: | 200 private: |
201 friend class test::QuicClientSessionPeer; | 201 friend class test::QuicClientSessionPeer; |
202 | 202 |
203 typedef std::set<Observer*> ObserverSet; | 203 typedef std::set<Observer*> ObserverSet; |
204 typedef std::list<StreamRequest*> StreamRequestQueue; | 204 typedef std::list<StreamRequest*> StreamRequestQueue; |
205 | 205 |
206 QuicReliableClientStream* CreateOutgoingReliableStreamImpl(); | 206 QuicReliableClientStream* CreateOutgoingReliableStreamImpl(); |
207 // A completion callback invoked when a read completes. | 207 // A completion callback invoked when a read completes. |
208 void OnReadComplete(int result); | 208 void OnReadComplete(int result); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // on this session. Existing stream will continue to be processed. | 261 // on this session. Existing stream will continue to be processed. |
262 bool going_away_; | 262 bool going_away_; |
263 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 263 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
264 | 264 |
265 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 265 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
266 }; | 266 }; |
267 | 267 |
268 } // namespace net | 268 } // namespace net |
269 | 269 |
270 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 270 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
OLD | NEW |