| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_HPACK_ENCODER_H_ | 5 #ifndef NET_SPDY_HPACK_ENCODER_H_ |
| 6 #define NET_SPDY_HPACK_ENCODER_H_ | 6 #define NET_SPDY_HPACK_ENCODER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 // Called upon a change to SETTINGS_HEADER_TABLE_SIZE. Specifically, this | 52 // Called upon a change to SETTINGS_HEADER_TABLE_SIZE. Specifically, this |
| 53 // is to be called after receiving (and sending an acknowledgement for) a | 53 // is to be called after receiving (and sending an acknowledgement for) a |
| 54 // SETTINGS_HEADER_TABLE_SIZE update from the remote decoding endpoint. | 54 // SETTINGS_HEADER_TABLE_SIZE update from the remote decoding endpoint. |
| 55 void ApplyHeaderTableSizeSetting(size_t size_setting); | 55 void ApplyHeaderTableSizeSetting(size_t size_setting); |
| 56 | 56 |
| 57 size_t CurrentHeaderTableSizeSetting() const { | 57 size_t CurrentHeaderTableSizeSetting() const { |
| 58 return header_table_.settings_size_bound(); | 58 return header_table_.settings_size_bound(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void SetHeaderTableDebugVisitor( |
| 62 std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) { |
| 63 header_table_.set_debug_visitor(std::move(visitor)); |
| 64 } |
| 65 |
| 61 private: | 66 private: |
| 62 typedef std::pair<base::StringPiece, base::StringPiece> Representation; | 67 typedef std::pair<base::StringPiece, base::StringPiece> Representation; |
| 63 typedef std::vector<Representation> Representations; | 68 typedef std::vector<Representation> Representations; |
| 64 | 69 |
| 65 // Emits a static/dynamic indexed representation (Section 7.1). | 70 // Emits a static/dynamic indexed representation (Section 7.1). |
| 66 void EmitIndex(const HpackEntry* entry); | 71 void EmitIndex(const HpackEntry* entry); |
| 67 | 72 |
| 68 // Emits a literal representation (Section 7.2). | 73 // Emits a literal representation (Section 7.2). |
| 69 void EmitIndexedLiteral(const Representation& representation); | 74 void EmitIndexedLiteral(const Representation& representation); |
| 70 void EmitNonIndexedLiteral(const Representation& representation); | 75 void EmitNonIndexedLiteral(const Representation& representation); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 92 size_t min_table_size_setting_received_; | 97 size_t min_table_size_setting_received_; |
| 93 bool allow_huffman_compression_; | 98 bool allow_huffman_compression_; |
| 94 bool should_emit_table_size_; | 99 bool should_emit_table_size_; |
| 95 | 100 |
| 96 DISALLOW_COPY_AND_ASSIGN(HpackEncoder); | 101 DISALLOW_COPY_AND_ASSIGN(HpackEncoder); |
| 97 }; | 102 }; |
| 98 | 103 |
| 99 } // namespace net | 104 } // namespace net |
| 100 | 105 |
| 101 #endif // NET_SPDY_HPACK_ENCODER_H_ | 106 #endif // NET_SPDY_HPACK_ENCODER_H_ |
| OLD | NEW |