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_CHROMIUM_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 10 #ifndef NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Returns true if the handshake has been confirmed. | 83 // Returns true if the handshake has been confirmed. |
84 bool IsCryptoHandshakeConfirmed() const; | 84 bool IsCryptoHandshakeConfirmed() const; |
85 | 85 |
86 // Starts a request to create a stream. If OK is returned, then | 86 // Starts a request to create a stream. If OK is returned, then |
87 // |stream_| will be updated with the newly created stream. If | 87 // |stream_| will be updated with the newly created stream. If |
88 // ERR_IO_PENDING is returned, then when the request is eventuallly | 88 // ERR_IO_PENDING is returned, then when the request is eventuallly |
89 // complete |callback| will be called. | 89 // complete |callback| will be called. |
90 int RequestStream(bool requires_confirmation, | 90 int RequestStream(bool requires_confirmation, |
91 const CompletionCallback& callback); | 91 const CompletionCallback& callback); |
92 | 92 |
93 // Releases |stream_| to the caller and sets |delegate| on it. | 93 // Releases |stream_| to the caller and sets |delegate| on the handle. |
94 QuicChromiumClientStream* ReleaseStream( | 94 std::unique_ptr<QuicChromiumClientStream::Handle> ReleaseStream( |
95 QuicChromiumClientStream::Delegate* delegate); | 95 QuicChromiumClientStream::Delegate* delegate); |
96 | 96 |
97 // Sends Rst for the stream, and makes sure that future calls to | 97 // Sends Rst for the stream, and makes sure that future calls to |
98 // IsClosedStream(id) return true, which ensures that any subsequent | 98 // IsClosedStream(id) return true, which ensures that any subsequent |
99 // frames related to this stream will be ignored (modulo flow | 99 // frames related to this stream will be ignored (modulo flow |
100 // control accounting). | 100 // control accounting). |
101 void ResetPromised(QuicStreamId id, QuicRstStreamErrorCode error_code); | 101 void ResetPromised(QuicStreamId id, QuicRstStreamErrorCode error_code); |
102 | 102 |
103 // Returns a new packet bundler while will cause writes to be batched up | 103 // Returns a new packet bundler while will cause writes to be batched up |
104 // until a packet is full, or the last bundler is destroyed. | 104 // until a packet is full, or the last bundler is destroyed. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // it has not yet been released. | 187 // it has not yet been released. |
188 ~StreamRequest(); | 188 ~StreamRequest(); |
189 | 189 |
190 // Starts a request to create a stream. If OK is returned, then | 190 // Starts a request to create a stream. If OK is returned, then |
191 // |stream_| will be updated with the newly created stream. If | 191 // |stream_| will be updated with the newly created stream. If |
192 // ERR_IO_PENDING is returned, then when the request is eventuallly | 192 // ERR_IO_PENDING is returned, then when the request is eventuallly |
193 // complete |callback| will be called. | 193 // complete |callback| will be called. |
194 int StartRequest(const CompletionCallback& callback); | 194 int StartRequest(const CompletionCallback& callback); |
195 | 195 |
196 // Releases |stream_| to the caller and sets |delegate| on it. | 196 // Releases |stream_| to the caller and sets |delegate| on it. |
197 QuicChromiumClientStream* ReleaseStream( | 197 std::unique_ptr<QuicChromiumClientStream::Handle> ReleaseStream( |
198 QuicChromiumClientStream::Delegate* delegate); | 198 QuicChromiumClientStream::Delegate* delegate); |
199 | 199 |
200 private: | 200 private: |
201 friend class QuicChromiumClientSession; | 201 friend class QuicChromiumClientSession; |
202 | 202 |
203 enum State { | 203 enum State { |
204 STATE_NONE, | 204 STATE_NONE, |
205 STATE_WAIT_FOR_CONFIRMATION, | 205 STATE_WAIT_FOR_CONFIRMATION, |
206 STATE_WAIT_FOR_CONFIRMATION_COMPLETE, | 206 STATE_WAIT_FOR_CONFIRMATION_COMPLETE, |
207 STATE_REQUEST_STREAM, | 207 STATE_REQUEST_STREAM, |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 // the current sockets_.size() == the passed in value. | 535 // the current sockets_.size() == the passed in value. |
536 bool migration_pending_; // True while migration is underway. | 536 bool migration_pending_; // True while migration is underway. |
537 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; | 537 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; |
538 | 538 |
539 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); | 539 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); |
540 }; | 540 }; |
541 | 541 |
542 } // namespace net | 542 } // namespace net |
543 | 543 |
544 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 544 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
OLD | NEW |