| 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 #ifndef NET_QUIC_QUIC_HTTP_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_HTTP_STREAM_H_ |
| 6 #define NET_QUIC_QUIC_HTTP_STREAM_H_ | 6 #define NET_QUIC_QUIC_HTTP_STREAM_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // The QuicHttpStream is a QUIC-specific HttpStream subclass. It holds a | 22 // The QuicHttpStream is a QUIC-specific HttpStream subclass. It holds a |
| 23 // non-owning pointer to a QuicReliableClientStream which it uses to | 23 // non-owning pointer to a QuicReliableClientStream which it uses to |
| 24 // send and receive data. | 24 // send and receive data. |
| 25 class NET_EXPORT_PRIVATE QuicHttpStream : | 25 class NET_EXPORT_PRIVATE QuicHttpStream : |
| 26 public QuicClientSession::Observer, | 26 public QuicClientSession::Observer, |
| 27 public QuicReliableClientStream::Delegate, | 27 public QuicReliableClientStream::Delegate, |
| 28 public HttpStream { | 28 public HttpStream { |
| 29 public: | 29 public: |
| 30 explicit QuicHttpStream(const base::WeakPtr<QuicClientSession>& session); | 30 explicit QuicHttpStream(const base::WeakPtr<QuicClientSession>& session); |
| 31 | 31 |
| 32 virtual ~QuicHttpStream(); | 32 ~QuicHttpStream() override; |
| 33 | 33 |
| 34 // HttpStream implementation. | 34 // HttpStream implementation. |
| 35 virtual int InitializeStream(const HttpRequestInfo* request_info, | 35 int InitializeStream(const HttpRequestInfo* request_info, |
| 36 RequestPriority priority, | 36 RequestPriority priority, |
| 37 const BoundNetLog& net_log, | 37 const BoundNetLog& net_log, |
| 38 const CompletionCallback& callback) override; | 38 const CompletionCallback& callback) override; |
| 39 virtual int SendRequest(const HttpRequestHeaders& request_headers, | 39 int SendRequest(const HttpRequestHeaders& request_headers, |
| 40 HttpResponseInfo* response, | 40 HttpResponseInfo* response, |
| 41 const CompletionCallback& callback) override; | 41 const CompletionCallback& callback) override; |
| 42 virtual UploadProgress GetUploadProgress() const override; | 42 UploadProgress GetUploadProgress() const override; |
| 43 virtual int ReadResponseHeaders(const CompletionCallback& callback) override; | 43 int ReadResponseHeaders(const CompletionCallback& callback) override; |
| 44 virtual int ReadResponseBody(IOBuffer* buf, | 44 int ReadResponseBody(IOBuffer* buf, |
| 45 int buf_len, | 45 int buf_len, |
| 46 const CompletionCallback& callback) override; | 46 const CompletionCallback& callback) override; |
| 47 virtual void Close(bool not_reusable) override; | 47 void Close(bool not_reusable) override; |
| 48 virtual HttpStream* RenewStreamForAuth() override; | 48 HttpStream* RenewStreamForAuth() override; |
| 49 virtual bool IsResponseBodyComplete() const override; | 49 bool IsResponseBodyComplete() const override; |
| 50 virtual bool CanFindEndOfResponse() const override; | 50 bool CanFindEndOfResponse() const override; |
| 51 virtual bool IsConnectionReused() const override; | 51 bool IsConnectionReused() const override; |
| 52 virtual void SetConnectionReused() override; | 52 void SetConnectionReused() override; |
| 53 virtual bool IsConnectionReusable() const override; | 53 bool IsConnectionReusable() const override; |
| 54 virtual int64 GetTotalReceivedBytes() const override; | 54 int64 GetTotalReceivedBytes() const override; |
| 55 virtual bool GetLoadTimingInfo( | 55 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; |
| 56 LoadTimingInfo* load_timing_info) const override; | 56 void GetSSLInfo(SSLInfo* ssl_info) override; |
| 57 virtual void GetSSLInfo(SSLInfo* ssl_info) override; | 57 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override; |
| 58 virtual void GetSSLCertRequestInfo( | 58 bool IsSpdyHttpStream() const override; |
| 59 SSLCertRequestInfo* cert_request_info) override; | 59 void Drain(HttpNetworkSession* session) override; |
| 60 virtual bool IsSpdyHttpStream() const override; | 60 void SetPriority(RequestPriority priority) override; |
| 61 virtual void Drain(HttpNetworkSession* session) override; | |
| 62 virtual void SetPriority(RequestPriority priority) override; | |
| 63 | 61 |
| 64 // QuicReliableClientStream::Delegate implementation | 62 // QuicReliableClientStream::Delegate implementation |
| 65 virtual int OnDataReceived(const char* data, int length) override; | 63 int OnDataReceived(const char* data, int length) override; |
| 66 virtual void OnClose(QuicErrorCode error) override; | 64 void OnClose(QuicErrorCode error) override; |
| 67 virtual void OnError(int error) override; | 65 void OnError(int error) override; |
| 68 virtual bool HasSendHeadersComplete() override; | 66 bool HasSendHeadersComplete() override; |
| 69 | 67 |
| 70 // QuicClientSession::Observer implementation | 68 // QuicClientSession::Observer implementation |
| 71 virtual void OnCryptoHandshakeConfirmed() override; | 69 void OnCryptoHandshakeConfirmed() override; |
| 72 virtual void OnSessionClosed(int error) override; | 70 void OnSessionClosed(int error) override; |
| 73 | 71 |
| 74 private: | 72 private: |
| 75 friend class test::QuicHttpStreamPeer; | 73 friend class test::QuicHttpStreamPeer; |
| 76 | 74 |
| 77 enum State { | 75 enum State { |
| 78 STATE_NONE, | 76 STATE_NONE, |
| 79 STATE_SEND_HEADERS, | 77 STATE_SEND_HEADERS, |
| 80 STATE_SEND_HEADERS_COMPLETE, | 78 STATE_SEND_HEADERS_COMPLETE, |
| 81 STATE_READ_REQUEST_BODY, | 79 STATE_READ_REQUEST_BODY, |
| 82 STATE_READ_REQUEST_BODY_COMPLETE, | 80 STATE_READ_REQUEST_BODY_COMPLETE, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 BoundNetLog stream_net_log_; | 162 BoundNetLog stream_net_log_; |
| 165 | 163 |
| 166 base::WeakPtrFactory<QuicHttpStream> weak_factory_; | 164 base::WeakPtrFactory<QuicHttpStream> weak_factory_; |
| 167 | 165 |
| 168 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); | 166 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); |
| 169 }; | 167 }; |
| 170 | 168 |
| 171 } // namespace net | 169 } // namespace net |
| 172 | 170 |
| 173 #endif // NET_QUIC_QUIC_HTTP_STREAM_H_ | 171 #endif // NET_QUIC_QUIC_HTTP_STREAM_H_ |
| OLD | NEW |