OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_HTTP_BIDIRECTIONAL_STREAM_H_ | 5 #ifndef NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
6 #define NET_HTTP_BIDIRECTIONAL_STREAM_H_ | 6 #define NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 // The delegate should not call BidirectionalStream::Cancel | 74 // The delegate should not call BidirectionalStream::Cancel |
75 // during this callback. | 75 // during this callback. |
76 virtual void OnDataSent() = 0; | 76 virtual void OnDataSent() = 0; |
77 | 77 |
78 // Called when trailers are received. This is called as soon as trailers | 78 // Called when trailers are received. This is called as soon as trailers |
79 // are received, which can happen before a read completes. | 79 // are received, which can happen before a read completes. |
80 // The delegate is able to continue reading if there is no pending read and | 80 // The delegate is able to continue reading if there is no pending read and |
81 // EOF has not been received, or to send data if there is no pending send. | 81 // EOF has not been received, or to send data if there is no pending send. |
82 virtual void OnTrailersReceived(const SpdyHeaderBlock& trailers) = 0; | 82 virtual void OnTrailersReceived(const SpdyHeaderBlock& trailers) = 0; |
83 | 83 |
84 // Called when the stream is closed or an error occurred. | 84 // Called when an error occurred. Do not call into the stream after this |
85 // No other delegate functions will be called after this. | 85 // point. |
kapishnikov
2016/06/01 22:09:49
I think it is important to keep the contract that
xunjieli
2016/06/01 23:08:22
Done.
| |
86 virtual void OnFailed(int error) = 0; | 86 virtual void OnFailed(int error) = 0; |
87 | 87 |
88 protected: | 88 protected: |
89 virtual ~Delegate(); | 89 virtual ~Delegate(); |
90 | 90 |
91 private: | 91 private: |
92 DISALLOW_COPY_AND_ASSIGN(Delegate); | 92 DISALLOW_COPY_AND_ASSIGN(Delegate); |
93 }; | 93 }; |
94 | 94 |
95 // Constructs a BidirectionalStream. |request_info| contains information about | 95 // Constructs a BidirectionalStream. |request_info| contains information about |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 std::vector<scoped_refptr<IOBuffer>> write_buffer_list_; | 244 std::vector<scoped_refptr<IOBuffer>> write_buffer_list_; |
245 // List of buffer length. | 245 // List of buffer length. |
246 std::vector<int> write_buffer_len_list_; | 246 std::vector<int> write_buffer_len_list_; |
247 | 247 |
248 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); | 248 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); |
249 }; | 249 }; |
250 | 250 |
251 } // namespace net | 251 } // namespace net |
252 | 252 |
253 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ | 253 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
OLD | NEW |