| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "net/spdy/http2_frame_decoder_adapter.h" | 5 #include "net/spdy/core/http2_frame_decoder_adapter.h" |
| 6 | 6 |
| 7 // Logging policy: If an error in the input is detected, VLOG(n) is used so that | 7 // Logging policy: If an error in the input is detected, VLOG(n) is used so that |
| 8 // the option exists to debug the situation. Otherwise, this code mostly uses | 8 // the option exists to debug the situation. Otherwise, this code mostly uses |
| 9 // DVLOG so that the logging does not slow down production code when things are | 9 // DVLOG so that the logging does not slow down production code when things are |
| 10 // working OK. | 10 // working OK. |
| 11 | 11 |
| 12 #include <stddef.h> | 12 #include <stddef.h> |
| 13 | 13 |
| 14 #include <cstdint> | 14 #include <cstdint> |
| 15 #include <cstring> | 15 #include <cstring> |
| 16 #include <utility> | 16 #include <utility> |
| 17 | 17 |
| 18 #include "base/logging.h" | 18 #include "base/logging.h" |
| 19 #include "base/optional.h" | 19 #include "base/optional.h" |
| 20 #include "base/sys_byteorder.h" | 20 #include "base/sys_byteorder.h" |
| 21 #include "net/http2/decoder/decode_buffer.h" | 21 #include "net/http2/decoder/decode_buffer.h" |
| 22 #include "net/http2/decoder/decode_status.h" | 22 #include "net/http2/decoder/decode_status.h" |
| 23 #include "net/http2/decoder/http2_frame_decoder.h" | 23 #include "net/http2/decoder/http2_frame_decoder.h" |
| 24 #include "net/http2/decoder/http2_frame_decoder_listener.h" | 24 #include "net/http2/decoder/http2_frame_decoder_listener.h" |
| 25 #include "net/http2/http2_constants.h" | 25 #include "net/http2/http2_constants.h" |
| 26 #include "net/http2/http2_structures.h" | 26 #include "net/http2/http2_structures.h" |
| 27 #include "net/spdy/hpack/hpack_decoder_interface.h" | 27 #include "net/spdy/core/hpack/hpack_decoder_interface.h" |
| 28 #include "net/spdy/hpack/hpack_header_table.h" | 28 #include "net/spdy/core/hpack/hpack_header_table.h" |
| 29 #include "net/spdy/core/spdy_alt_svc_wire_format.h" |
| 30 #include "net/spdy/core/spdy_bug_tracker.h" |
| 31 #include "net/spdy/core/spdy_frame_builder.h" |
| 32 #include "net/spdy/core/spdy_header_block.h" |
| 33 #include "net/spdy/core/spdy_headers_handler_interface.h" |
| 34 #include "net/spdy/core/spdy_protocol.h" |
| 29 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" | 35 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" |
| 30 #include "net/spdy/platform/api/spdy_string.h" | 36 #include "net/spdy/platform/api/spdy_string.h" |
| 31 #include "net/spdy/spdy_alt_svc_wire_format.h" | |
| 32 #include "net/spdy/spdy_bug_tracker.h" | |
| 33 #include "net/spdy/spdy_frame_builder.h" | |
| 34 #include "net/spdy/spdy_header_block.h" | |
| 35 #include "net/spdy/spdy_headers_handler_interface.h" | |
| 36 #include "net/spdy/spdy_protocol.h" | |
| 37 | 37 |
| 38 namespace net { | 38 namespace net { |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 const bool kHasPriorityFields = true; | 42 const bool kHasPriorityFields = true; |
| 43 const bool kNotHasPriorityFields = false; | 43 const bool kNotHasPriorityFields = false; |
| 44 | 44 |
| 45 bool IsPaddable(Http2FrameType type) { | 45 bool IsPaddable(Http2FrameType type) { |
| 46 return type == Http2FrameType::DATA || type == Http2FrameType::HEADERS || | 46 return type == Http2FrameType::DATA || type == Http2FrameType::HEADERS || |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 | 992 |
| 993 } // namespace | 993 } // namespace |
| 994 | 994 |
| 995 std::unique_ptr<SpdyFramerDecoderAdapter> CreateHttp2FrameDecoderAdapter( | 995 std::unique_ptr<SpdyFramerDecoderAdapter> CreateHttp2FrameDecoderAdapter( |
| 996 SpdyFramer* outer_framer) { | 996 SpdyFramer* outer_framer) { |
| 997 return std::unique_ptr<SpdyFramerDecoderAdapter>( | 997 return std::unique_ptr<SpdyFramerDecoderAdapter>( |
| 998 new Http2DecoderAdapter(outer_framer)); | 998 new Http2DecoderAdapter(outer_framer)); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 } // namespace net | 1001 } // namespace net |
| OLD | NEW |