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. No other delegate functions will be called after this. |
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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 std::vector<scoped_refptr<IOBuffer>> write_buffer_list_; | 245 std::vector<scoped_refptr<IOBuffer>> write_buffer_list_; |
246 // List of buffer length. | 246 // List of buffer length. |
247 std::vector<int> write_buffer_len_list_; | 247 std::vector<int> write_buffer_len_list_; |
248 | 248 |
249 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); | 249 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); |
250 }; | 250 }; |
251 | 251 |
252 } // namespace net | 252 } // namespace net |
253 | 253 |
254 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ | 254 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
OLD | NEW |