| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 101   virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE; | 101   virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE; | 
| 102   virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; | 102   virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; | 
| 103   virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; | 103   virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; | 
| 104   virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE; | 104   virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE; | 
| 105   virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 105   virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 
| 106 | 106 | 
| 107   // QuicConnectionVisitorInterface methods: | 107   // QuicConnectionVisitorInterface methods: | 
| 108   virtual void ConnectionClose(QuicErrorCode error, bool from_peer) OVERRIDE; | 108   virtual void ConnectionClose(QuicErrorCode error, bool from_peer) OVERRIDE; | 
| 109 | 109 | 
| 110   // Performs a crypto handshake with the server. | 110   // Performs a crypto handshake with the server. | 
| 111   int CryptoConnect(const CompletionCallback& callback); | 111   int CryptoConnect(bool require_confirmation, | 
|  | 112                     const CompletionCallback& callback); | 
| 112 | 113 | 
| 113   // Causes the QuicConnectionHelper to start reading from the socket | 114   // Causes the QuicConnectionHelper to start reading from the socket | 
| 114   // and passing the data along to the QuicConnection. | 115   // and passing the data along to the QuicConnection. | 
| 115   void StartReading(); | 116   void StartReading(); | 
| 116 | 117 | 
| 117   // Close the session because of |error| and notifies the factory | 118   // Close the session because of |error| and notifies the factory | 
| 118   // that this session has been closed, which will delete the session. | 119   // that this session has been closed, which will delete the session. | 
| 119   void CloseSessionOnError(int error); | 120   void CloseSessionOnError(int error); | 
| 120 | 121 | 
| 121   base::Value* GetInfoAsValue(const HostPortPair& pair) const; | 122   base::Value* GetInfoAsValue(const HostPortPair& pair) const; | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
| 140 | 141 | 
| 141   void CloseSessionOnErrorInner(int error); | 142   void CloseSessionOnErrorInner(int error); | 
| 142 | 143 | 
| 143   // Posts a task to notify the factory that this session has been closed. | 144   // Posts a task to notify the factory that this session has been closed. | 
| 144   void NotifyFactoryOfSessionCloseLater(); | 145   void NotifyFactoryOfSessionCloseLater(); | 
| 145 | 146 | 
| 146   // Notifies the factory that this session has been closed which will | 147   // Notifies the factory that this session has been closed which will | 
| 147   // delete |this|. | 148   // delete |this|. | 
| 148   void NotifyFactoryOfSessionClose(); | 149   void NotifyFactoryOfSessionClose(); | 
| 149 | 150 | 
| 150   base::WeakPtrFactory<QuicClientSession> weak_factory_; | 151   bool require_confirmation_; | 
| 151   scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 152   scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 
| 152   QuicStreamFactory* stream_factory_; | 153   QuicStreamFactory* stream_factory_; | 
| 153   scoped_ptr<DatagramClientSocket> socket_; | 154   scoped_ptr<DatagramClientSocket> socket_; | 
| 154   scoped_refptr<IOBufferWithSize> read_buffer_; | 155   scoped_refptr<IOBufferWithSize> read_buffer_; | 
| 155   StreamRequestQueue stream_requests_; | 156   StreamRequestQueue stream_requests_; | 
| 156   bool read_pending_; | 157   bool read_pending_; | 
| 157   CompletionCallback callback_; | 158   CompletionCallback callback_; | 
| 158   size_t num_total_streams_; | 159   size_t num_total_streams_; | 
| 159   BoundNetLog net_log_; | 160   BoundNetLog net_log_; | 
| 160   QuicConnectionLogger logger_; | 161   QuicConnectionLogger logger_; | 
|  | 162   base::WeakPtrFactory<QuicClientSession> weak_factory_; | 
| 161 | 163 | 
| 162   DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 164   DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 
| 163 }; | 165 }; | 
| 164 | 166 | 
| 165 }  // namespace net | 167 }  // namespace net | 
| 166 | 168 | 
| 167 #endif  // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 169 #endif  // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 
| OLD | NEW | 
|---|