OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_TOOLS_FLIP_SERVER_BALSA_VISITOR_INTERFACE_H_ | 5 #ifndef NET_TOOLS_FLIP_SERVER_BALSA_VISITOR_INTERFACE_H_ |
6 #define NET_TOOLS_FLIP_SERVER_BALSA_VISITOR_INTERFACE_H_ | 6 #define NET_TOOLS_FLIP_SERVER_BALSA_VISITOR_INTERFACE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <cstddef> | 9 #include <cstddef> |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 class BalsaFrame; | 13 class BalsaFrame; |
14 class BalsaHeaders; | 14 class BalsaHeaders; |
15 | 15 |
16 // By default the BalsaFrame instantiates a class derived from this interface | 16 // By default the BalsaFrame instantiates a class derived from this interface |
17 // which does absolutely nothing. If you'd prefer to have interesting | 17 // which does absolutely nothing. If you'd prefer to have interesting |
18 // functionality execute when any of the below functions are called by the | 18 // functionality execute when any of the below functions are called by the |
19 // BalsaFrame, then you should subclass it, and set an instantiation of your | 19 // BalsaFrame, then you should subclass it, and set an instantiation of your |
20 // subclass as the current visitor for the BalsaFrame class using | 20 // subclass as the current visitor for the BalsaFrame class using |
21 // BalsaFrame::set_visitor(). | 21 // BalsaFrame::set_visitor(). |
22 class BalsaVisitorInterface { | 22 class BalsaVisitorInterface { |
23 public: | 23 public: |
24 virtual ~BalsaVisitorInterface() {} | 24 virtual ~BalsaVisitorInterface() {} |
25 | 25 |
26 // Summary: | 26 // Summary: |
27 // This is how the BalsaFrame passes you the raw input which it knows to | 27 // This is how the BalsaFrame passes you the raw input which it knows to |
28 // be a part of the body. To be clear, every byte of the Balsa which isn't | 28 // be a part of the body. To be clear, every byte of the Balsa which isn't |
29 // part of the header (or it's framing), or trailers will be passed through | 29 // part of the header (or its framing), or trailers will be passed through |
30 // this function. This includes data as well as chunking framing. | 30 // this function. This includes data as well as chunking framing. |
31 // Arguments: | 31 // Arguments: |
32 // input - contains the bytes available for read. | 32 // input - contains the bytes available for read. |
33 // size - contains the number of bytes it is safe to read from input. | 33 // size - contains the number of bytes it is safe to read from input. |
34 virtual void ProcessBodyInput(const char *input, size_t size) = 0; | 34 virtual void ProcessBodyInput(const char *input, size_t size) = 0; |
35 | 35 |
36 // Summary: | 36 // Summary: |
37 // This is like ProcessBodyInput, but it will only include those parts of | 37 // This is like ProcessBodyInput, but it will only include those parts of |
38 // the body which would be stored by a program such as wget, i.e. the bytes | 38 // the body which would be stored by a program such as wget, i.e. the bytes |
39 // indicating chunking (it will have been omitted). Trailers will not be | 39 // indicating chunking (it will have been omitted). Trailers will not be |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // errors could occur. | 173 // errors could occur. |
174 // Arguments: | 174 // Arguments: |
175 // framer - the framer in which an error occured. | 175 // framer - the framer in which an error occured. |
176 virtual void HandleBodyError(BalsaFrame* framer) = 0; | 176 virtual void HandleBodyError(BalsaFrame* framer) = 0; |
177 }; | 177 }; |
178 | 178 |
179 } // namespace net | 179 } // namespace net |
180 | 180 |
181 #endif // NET_TOOLS_FLIP_SERVER_BALSA_VISITOR_INTERFACE_H_ | 181 #endif // NET_TOOLS_FLIP_SERVER_BALSA_VISITOR_INTERFACE_H_ |
182 | 182 |
OLD | NEW |