| 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 |
| 128 // Called when a chunk of header data is available. This is called | 142 // Called when a chunk of header data is available. This is called |
| 129 // after OnSynStream, OnSynReply, OnHeaders(), or OnPushPromise. | 143 // after OnSynStream, OnSynReply, OnHeaders(), or OnPushPromise. |
| 130 // |stream_id| The stream receiving the header data. | 144 // |stream_id| The stream receiving the header data. |
| 131 // |header_data| A buffer containing the header data chunk received. | 145 // |header_data| A buffer containing the header data chunk received. |
| 132 // |len| The length of the header data buffer. A length of zero indicates | 146 // |len| The length of the header data buffer. A length of zero indicates |
| 133 // that the header data block has been completely sent. | 147 // that the header data block has been completely sent. |
| 134 // When this function returns true the visitor indicates that it accepted | 148 // When this function returns true the visitor indicates that it accepted |
| 135 // all of the data. Returning false indicates that that an unrecoverable | 149 // all of the data. Returning false indicates that that an unrecoverable |
| 136 // error has occurred, such as bad header data or resource exhaustion. | 150 // error has occurred, such as bad header data or resource exhaustion. |
| 137 virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id, | 151 virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id, |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 bool end_stream_when_done_; | 795 bool end_stream_when_done_; |
| 782 | 796 |
| 783 // If true, then ProcessInput returns after processing a full frame, | 797 // If true, then ProcessInput returns after processing a full frame, |
| 784 // rather than reading all available input. | 798 // rather than reading all available input. |
| 785 bool process_single_input_frame_ = false; | 799 bool process_single_input_frame_ = false; |
| 786 }; | 800 }; |
| 787 | 801 |
| 788 } // namespace net | 802 } // namespace net |
| 789 | 803 |
| 790 #endif // NET_SPDY_SPDY_FRAMER_H_ | 804 #endif // NET_SPDY_SPDY_FRAMER_H_ |
| OLD | NEW |