| 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_FRAMER_H_ | 5 #ifndef NET_SPDY_SPDY_FRAMER_H_ |
| 6 #define NET_SPDY_SPDY_FRAMER_H_ | 6 #define NET_SPDY_SPDY_FRAMER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 virtual void OnStreamFrameData(SpdyStreamId stream_id, | 118 virtual void OnStreamFrameData(SpdyStreamId stream_id, |
| 119 const char* data, | 119 const char* data, |
| 120 size_t len, | 120 size_t len, |
| 121 bool fin) = 0; | 121 bool fin) = 0; |
| 122 | 122 |
| 123 // Called when padding is received (padding length field or padding octets). | 123 // Called when padding is received (padding length field or padding octets). |
| 124 // |stream_id| The stream receiving data. | 124 // |stream_id| The stream receiving data. |
| 125 // |len| The number of padding octets. | 125 // |len| The number of padding octets. |
| 126 virtual void OnStreamPadding(SpdyStreamId stream_id, size_t len) = 0; | 126 virtual void OnStreamPadding(SpdyStreamId stream_id, size_t len) = 0; |
| 127 | 127 |
| 128 // Called just before processing the payload of a frame containing header | |
| 129 // data. Should return an implementation of SpdyHeadersHandlerInterface that | |
| 130 // will receive headers for stream |stream_id|. The caller will not take | |
| 131 // ownership of the headers handler. The same instance should be returned | |
| 132 // for all header frames comprising a logical header block (i.e. until | |
| 133 // OnHeaderFrameEnd() is called with end_headers == true). | |
| 134 virtual SpdyHeadersHandlerInterface* OnHeaderFrameStart( | |
| 135 SpdyStreamId stream_id) = 0; | |
| 136 | |
| 137 // Called after processing the payload of a frame containing header data. | |
| 138 // |end_headers| is true if there will not be any subsequent CONTINUATION | |
| 139 // frames. | |
| 140 virtual void OnHeaderFrameEnd(SpdyStreamId stream_id, bool end_headers) = 0; | |
| 141 | |
| 142 // Called when a chunk of header data is available. This is called | 128 // Called when a chunk of header data is available. This is called |
| 143 // after OnSynStream, OnSynReply, OnHeaders(), or OnPushPromise. | 129 // after OnSynStream, OnSynReply, OnHeaders(), or OnPushPromise. |
| 144 // |stream_id| The stream receiving the header data. | 130 // |stream_id| The stream receiving the header data. |
| 145 // |header_data| A buffer containing the header data chunk received. | 131 // |header_data| A buffer containing the header data chunk received. |
| 146 // |len| The length of the header data buffer. A length of zero indicates | 132 // |len| The length of the header data buffer. A length of zero indicates |
| 147 // that the header data block has been completely sent. | 133 // that the header data block has been completely sent. |
| 148 // When this function returns true the visitor indicates that it accepted | 134 // When this function returns true the visitor indicates that it accepted |
| 149 // all of the data. Returning false indicates that that an unrecoverable | 135 // all of the data. Returning false indicates that that an unrecoverable |
| 150 // error has occurred, such as bad header data or resource exhaustion. | 136 // error has occurred, such as bad header data or resource exhaustion. |
| 151 virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id, | 137 virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id, |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 bool end_stream_when_done_; | 781 bool end_stream_when_done_; |
| 796 | 782 |
| 797 // If true, then ProcessInput returns after processing a full frame, | 783 // If true, then ProcessInput returns after processing a full frame, |
| 798 // rather than reading all available input. | 784 // rather than reading all available input. |
| 799 bool process_single_input_frame_ = false; | 785 bool process_single_input_frame_ = false; |
| 800 }; | 786 }; |
| 801 | 787 |
| 802 } // namespace net | 788 } // namespace net |
| 803 | 789 |
| 804 #endif // NET_SPDY_SPDY_FRAMER_H_ | 790 #endif // NET_SPDY_SPDY_FRAMER_H_ |
| OLD | NEW |