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

Side by Side Diff: net/quic/chromium/quic_chromium_client_session.h

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

Powered by Google App Engine
This is Rietveld 408576698