| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_DECODER_ADAPTER_H_ | 5 #ifndef NET_SPDY_SPDY_FRAMER_DECODER_ADAPTER_H_ |
| 6 #define NET_SPDY_SPDY_FRAMER_DECODER_ADAPTER_H_ | 6 #define NET_SPDY_SPDY_FRAMER_DECODER_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <cstdint> | 10 #include <cstdint> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 virtual SpdyFramer::SpdyState state() const = 0; | 68 virtual SpdyFramer::SpdyState state() const = 0; |
| 69 | 69 |
| 70 // Current error code (NO_ERROR if state != ERROR). | 70 // Current error code (NO_ERROR if state != ERROR). |
| 71 virtual SpdyFramer::SpdyFramerError spdy_framer_error() const = 0; | 71 virtual SpdyFramer::SpdyFramerError spdy_framer_error() const = 0; |
| 72 | 72 |
| 73 // Has any frame header looked like the start of an HTTP/1.1 (or earlier) | 73 // Has any frame header looked like the start of an HTTP/1.1 (or earlier) |
| 74 // response? Used to detect if a backend/server that we sent a request to | 74 // response? Used to detect if a backend/server that we sent a request to |
| 75 // has responded with an HTTP/1.1 (or earlier) response. | 75 // has responded with an HTTP/1.1 (or earlier) response. |
| 76 virtual bool probable_http_response() const = 0; | 76 virtual bool probable_http_response() const = 0; |
| 77 | 77 |
| 78 // Returns the estimate of dynamically allocated memory in bytes. |
| 79 virtual size_t EstimateMemoryUsage() const = 0; |
| 80 |
| 78 private: | 81 private: |
| 79 SpdyFramerVisitorInterface* visitor_ = nullptr; | 82 SpdyFramerVisitorInterface* visitor_ = nullptr; |
| 80 SpdyFramerDebugVisitorInterface* debug_visitor_ = nullptr; | 83 SpdyFramerDebugVisitorInterface* debug_visitor_ = nullptr; |
| 81 bool process_single_input_frame_ = false; | 84 bool process_single_input_frame_ = false; |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 // Create an instance of NestedSpdyFramerDecoder, which implements | 87 // Create an instance of NestedSpdyFramerDecoder, which implements |
| 85 // SpdyFramerDecoderAdapter, delegating to a SpdyFramer instance that will | 88 // SpdyFramerDecoderAdapter, delegating to a SpdyFramer instance that will |
| 86 // actually perform the decoding (when requested via ProcessInput). This allows | 89 // actually perform the decoding (when requested via ProcessInput). This allows |
| 87 // us to test the SpdyFramerDecoderAdapter mechanism without changing the type | 90 // us to test the SpdyFramerDecoderAdapter mechanism without changing the type |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 SpdyFramer* framer() const { return framer_; } | 156 SpdyFramer* framer() const { return framer_; } |
| 154 | 157 |
| 155 private: | 158 private: |
| 156 SpdyFramerVisitorInterface* const visitor_; | 159 SpdyFramerVisitorInterface* const visitor_; |
| 157 SpdyFramer* const framer_; | 160 SpdyFramer* const framer_; |
| 158 }; | 161 }; |
| 159 | 162 |
| 160 } // namespace net | 163 } // namespace net |
| 161 | 164 |
| 162 #endif // NET_SPDY_SPDY_FRAMER_DECODER_ADAPTER_H_ | 165 #endif // NET_SPDY_SPDY_FRAMER_DECODER_ADAPTER_H_ |
| OLD | NEW |