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