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

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

Issue 23587004: If the stream is being closed locally (for example in the case of a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 7 years, 3 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
« no previous file with comments | « no previous file | net/quic/quic_client_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_QUIC_CLIENT_SESSION_H_ 10 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_H_
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 int TryCreateStream(StreamRequest* request, 95 int TryCreateStream(StreamRequest* request,
96 QuicReliableClientStream** stream); 96 QuicReliableClientStream** stream);
97 97
98 // Cancels the pending stream creation request. 98 // Cancels the pending stream creation request.
99 void CancelRequest(StreamRequest* request); 99 void CancelRequest(StreamRequest* request);
100 100
101 // QuicSession methods: 101 // QuicSession methods:
102 virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE; 102 virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE;
103 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; 103 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE;
104 virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; 104 virtual void CloseStream(QuicStreamId stream_id) OVERRIDE;
105 virtual void SendRstStream(QuicStreamId id,
106 QuicRstStreamErrorCode error) OVERRIDE;
105 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE; 107 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE;
106 virtual void OnCryptoHandshakeMessageSent( 108 virtual void OnCryptoHandshakeMessageSent(
107 const CryptoHandshakeMessage& message) OVERRIDE; 109 const CryptoHandshakeMessage& message) OVERRIDE;
108 virtual void OnCryptoHandshakeMessageReceived( 110 virtual void OnCryptoHandshakeMessageReceived(
109 const CryptoHandshakeMessage& message) OVERRIDE; 111 const CryptoHandshakeMessage& message) OVERRIDE;
110 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; 112 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
111 113
112 // QuicConnectionVisitorInterface methods: 114 // QuicConnectionVisitorInterface methods:
113 virtual void ConnectionClose(QuicErrorCode error, bool from_peer) OVERRIDE; 115 virtual void ConnectionClose(QuicErrorCode error, bool from_peer) OVERRIDE;
114 116
(...skipping 22 matching lines...) Expand all
137 139
138 private: 140 private:
139 friend class test::QuicClientSessionPeer; 141 friend class test::QuicClientSessionPeer;
140 142
141 typedef std::list<StreamRequest*> StreamRequestQueue; 143 typedef std::list<StreamRequest*> StreamRequestQueue;
142 144
143 QuicReliableClientStream* CreateOutgoingReliableStreamImpl(); 145 QuicReliableClientStream* CreateOutgoingReliableStreamImpl();
144 // A completion callback invoked when a read completes. 146 // A completion callback invoked when a read completes.
145 void OnReadComplete(int result); 147 void OnReadComplete(int result);
146 148
149 void OnClosedStream();
150
147 void CloseSessionOnErrorInner(int error); 151 void CloseSessionOnErrorInner(int error);
148 152
149 // Posts a task to notify the factory that this session has been closed. 153 // Posts a task to notify the factory that this session has been closed.
150 void NotifyFactoryOfSessionCloseLater(); 154 void NotifyFactoryOfSessionCloseLater();
151 155
152 // Notifies the factory that this session has been closed which will 156 // Notifies the factory that this session has been closed which will
153 // delete |this|. 157 // delete |this|.
154 void NotifyFactoryOfSessionClose(); 158 void NotifyFactoryOfSessionClose();
155 159
156 bool require_confirmation_; 160 bool require_confirmation_;
157 scoped_ptr<QuicCryptoClientStream> crypto_stream_; 161 scoped_ptr<QuicCryptoClientStream> crypto_stream_;
158 QuicStreamFactory* stream_factory_; 162 QuicStreamFactory* stream_factory_;
159 scoped_ptr<DatagramClientSocket> socket_; 163 scoped_ptr<DatagramClientSocket> socket_;
160 scoped_refptr<IOBufferWithSize> read_buffer_; 164 scoped_refptr<IOBufferWithSize> read_buffer_;
161 StreamRequestQueue stream_requests_; 165 StreamRequestQueue stream_requests_;
162 bool read_pending_; 166 bool read_pending_;
163 CompletionCallback callback_; 167 CompletionCallback callback_;
164 size_t num_total_streams_; 168 size_t num_total_streams_;
165 BoundNetLog net_log_; 169 BoundNetLog net_log_;
166 QuicConnectionLogger logger_; 170 QuicConnectionLogger logger_;
167 base::WeakPtrFactory<QuicClientSession> weak_factory_; 171 base::WeakPtrFactory<QuicClientSession> weak_factory_;
168 172
169 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); 173 DISALLOW_COPY_AND_ASSIGN(QuicClientSession);
170 }; 174 };
171 175
172 } // namespace net 176 } // namespace net
173 177
174 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ 178 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698