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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 virtual void GetSSLCertRequestInfo( | 70 virtual void GetSSLCertRequestInfo( |
71 SSLCertRequestInfo* cert_request_info) OVERRIDE; | 71 SSLCertRequestInfo* cert_request_info) OVERRIDE; |
72 virtual bool IsSpdyHttpStream() const OVERRIDE; | 72 virtual bool IsSpdyHttpStream() const OVERRIDE; |
73 virtual void LogNumRttVsBytesMetrics() const OVERRIDE {} | 73 virtual void LogNumRttVsBytesMetrics() const OVERRIDE {} |
74 virtual void Drain(HttpNetworkSession* session) OVERRIDE; | 74 virtual void Drain(HttpNetworkSession* session) OVERRIDE; |
75 | 75 |
76 // SpdyStream::Delegate implementation. | 76 // SpdyStream::Delegate implementation. |
77 virtual bool OnSendHeadersComplete(int status) OVERRIDE; | 77 virtual bool OnSendHeadersComplete(int status) OVERRIDE; |
78 virtual int OnSendBody() OVERRIDE; | 78 virtual int OnSendBody() OVERRIDE; |
79 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE; | 79 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE; |
| 80 virtual int OnSendChunkedBody() OVERRIDE; |
| 81 virtual int OnSendChunkedBodyComplete(int status, bool* eof) OVERRIDE; |
80 virtual int OnResponseReceived(const SpdyHeaderBlock& response, | 82 virtual int OnResponseReceived(const SpdyHeaderBlock& response, |
81 base::Time response_time, | 83 base::Time response_time, |
82 int status) OVERRIDE; | 84 int status) OVERRIDE; |
83 virtual void OnDataReceived(const char* buffer, int bytes) OVERRIDE; | 85 virtual void OnDataReceived(const char* buffer, int bytes) OVERRIDE; |
84 virtual void OnDataSent(int length) OVERRIDE; | 86 virtual void OnDataSent(int length) OVERRIDE; |
85 virtual void OnClose(int status) OVERRIDE; | 87 virtual void OnClose(int status) OVERRIDE; |
86 virtual void set_chunk_callback(ChunkCallback* callback) OVERRIDE; | 88 virtual void set_chunk_callback(ChunkCallback* callback) OVERRIDE; |
| 89 virtual bool IsRequestBodyChunked() OVERRIDE; |
87 | 90 |
88 private: | 91 private: |
89 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy2Test, | 92 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy2Test, |
90 FlowControlStallResume); | 93 FlowControlStallResume); |
91 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, | 94 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, |
92 FlowControlStallResume); | 95 FlowControlStallResume); |
93 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, | 96 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, |
94 FlowControlStallResumeAfterSettings); | 97 FlowControlStallResumeAfterSettings); |
95 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, | 98 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, |
96 FlowControlNegativeSendWindowSize); | 99 FlowControlNegativeSendWindowSize); |
97 | 100 |
| 101 // Called from OnSendBody and OnSendChunkedBody to send the data. |
| 102 int SendBody(); |
| 103 // Called from OnSendBodyComplete and OnSendChunkedBodyComplete. |
| 104 // |eof| indicates if the entire body data has been sent or not. |
| 105 // If all the data hasn't been sent, it goes back to SendBody to send the |
| 106 // remaining data. |
| 107 int SendBodyComplete(int status, bool* eof); |
| 108 |
98 // Call the user callback. | 109 // Call the user callback. |
99 void DoCallback(int rv); | 110 void DoCallback(int rv); |
100 | 111 |
101 void ScheduleBufferedReadCallback(); | 112 void ScheduleBufferedReadCallback(); |
102 | 113 |
103 // Returns true if the callback is invoked. | 114 // Returns true if the callback is invoked. |
104 bool DoBufferedReadCallback(); | 115 bool DoBufferedReadCallback(); |
105 bool ShouldWaitForMoreBufferedData() const; | 116 bool ShouldWaitForMoreBufferedData() const; |
106 | 117 |
107 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; | 118 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 bool direct_; | 159 bool direct_; |
149 | 160 |
150 bool send_last_chunk_; | 161 bool send_last_chunk_; |
151 | 162 |
152 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); | 163 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); |
153 }; | 164 }; |
154 | 165 |
155 } // namespace net | 166 } // namespace net |
156 | 167 |
157 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ | 168 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ |
OLD | NEW |