| 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_SPDY_SPDY_HTTP_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_HTTP_STREAM_H_ |
| 6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ | 6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 SpdyStream* stream() { return stream_.get(); } | 37 SpdyStream* stream() { return stream_.get(); } |
| 38 | 38 |
| 39 // Cancels any callbacks from being invoked and deletes the stream. | 39 // Cancels any callbacks from being invoked and deletes the stream. |
| 40 void Cancel(); | 40 void Cancel(); |
| 41 | 41 |
| 42 // HttpStream implementation. | 42 // HttpStream implementation. |
| 43 | 43 |
| 44 virtual int InitializeStream(const HttpRequestInfo* request_info, | 44 virtual int InitializeStream(const HttpRequestInfo* request_info, |
| 45 RequestPriority priority, | 45 RequestPriority priority, |
| 46 const BoundNetLog& net_log, | 46 const BoundNetLog& net_log, |
| 47 const CompletionCallback& callback) OVERRIDE; | 47 const CompletionCallback& callback) override; |
| 48 | 48 |
| 49 virtual int SendRequest(const HttpRequestHeaders& headers, | 49 virtual int SendRequest(const HttpRequestHeaders& headers, |
| 50 HttpResponseInfo* response, | 50 HttpResponseInfo* response, |
| 51 const CompletionCallback& callback) OVERRIDE; | 51 const CompletionCallback& callback) override; |
| 52 virtual UploadProgress GetUploadProgress() const OVERRIDE; | 52 virtual UploadProgress GetUploadProgress() const override; |
| 53 virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE; | 53 virtual int ReadResponseHeaders(const CompletionCallback& callback) override; |
| 54 virtual int ReadResponseBody(IOBuffer* buf, | 54 virtual int ReadResponseBody(IOBuffer* buf, |
| 55 int buf_len, | 55 int buf_len, |
| 56 const CompletionCallback& callback) OVERRIDE; | 56 const CompletionCallback& callback) override; |
| 57 virtual void Close(bool not_reusable) OVERRIDE; | 57 virtual void Close(bool not_reusable) override; |
| 58 virtual HttpStream* RenewStreamForAuth() OVERRIDE; | 58 virtual HttpStream* RenewStreamForAuth() override; |
| 59 virtual bool IsResponseBodyComplete() const OVERRIDE; | 59 virtual bool IsResponseBodyComplete() const override; |
| 60 virtual bool CanFindEndOfResponse() const OVERRIDE; | 60 virtual bool CanFindEndOfResponse() const override; |
| 61 | 61 |
| 62 // Must not be called if a NULL SpdySession was pssed into the | 62 // Must not be called if a NULL SpdySession was pssed into the |
| 63 // constructor. | 63 // constructor. |
| 64 virtual bool IsConnectionReused() const OVERRIDE; | 64 virtual bool IsConnectionReused() const override; |
| 65 | 65 |
| 66 virtual void SetConnectionReused() OVERRIDE; | 66 virtual void SetConnectionReused() override; |
| 67 virtual bool IsConnectionReusable() const OVERRIDE; | 67 virtual bool IsConnectionReusable() const override; |
| 68 virtual int64 GetTotalReceivedBytes() const OVERRIDE; | 68 virtual int64 GetTotalReceivedBytes() const override; |
| 69 virtual bool GetLoadTimingInfo( | 69 virtual bool GetLoadTimingInfo( |
| 70 LoadTimingInfo* load_timing_info) const OVERRIDE; | 70 LoadTimingInfo* load_timing_info) const override; |
| 71 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 71 virtual void GetSSLInfo(SSLInfo* ssl_info) override; |
| 72 virtual void GetSSLCertRequestInfo( | 72 virtual void GetSSLCertRequestInfo( |
| 73 SSLCertRequestInfo* cert_request_info) OVERRIDE; | 73 SSLCertRequestInfo* cert_request_info) override; |
| 74 virtual bool IsSpdyHttpStream() const OVERRIDE; | 74 virtual bool IsSpdyHttpStream() const override; |
| 75 virtual void Drain(HttpNetworkSession* session) OVERRIDE; | 75 virtual void Drain(HttpNetworkSession* session) override; |
| 76 virtual void SetPriority(RequestPriority priority) OVERRIDE; | 76 virtual void SetPriority(RequestPriority priority) override; |
| 77 | 77 |
| 78 // SpdyStream::Delegate implementation. | 78 // SpdyStream::Delegate implementation. |
| 79 virtual void OnRequestHeadersSent() OVERRIDE; | 79 virtual void OnRequestHeadersSent() override; |
| 80 virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated( | 80 virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated( |
| 81 const SpdyHeaderBlock& response_headers) OVERRIDE; | 81 const SpdyHeaderBlock& response_headers) override; |
| 82 virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE; | 82 virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override; |
| 83 virtual void OnDataSent() OVERRIDE; | 83 virtual void OnDataSent() override; |
| 84 virtual void OnClose(int status) OVERRIDE; | 84 virtual void OnClose(int status) override; |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 // Must be called only when |request_info_| is non-NULL. | 87 // Must be called only when |request_info_| is non-NULL. |
| 88 bool HasUploadData() const; | 88 bool HasUploadData() const; |
| 89 | 89 |
| 90 void OnStreamCreated(const CompletionCallback& callback, int rv); | 90 void OnStreamCreated(const CompletionCallback& callback, int rv); |
| 91 | 91 |
| 92 // Reads the remaining data (whether chunked or not) from the | 92 // Reads the remaining data (whether chunked or not) from the |
| 93 // request body stream and sends it if there's any. The read and | 93 // request body stream and sends it if there's any. The read and |
| 94 // subsequent sending may happen asynchronously. Must be called only | 94 // subsequent sending may happen asynchronously. Must be called only |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 bool direct_; | 159 bool direct_; |
| 160 | 160 |
| 161 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; | 161 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; |
| 162 | 162 |
| 163 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); | 163 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 } // namespace net | 166 } // namespace net |
| 167 | 167 |
| 168 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ | 168 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ |
| OLD | NEW |