| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 ~HpackEncoder(); | 38 ~HpackEncoder(); |
| 39 | 39 |
| 40 // Encodes the given header set into the given string. Returns | 40 // Encodes the given header set into the given string. Returns |
| 41 // whether or not the encoding was successful. | 41 // whether or not the encoding was successful. |
| 42 bool EncodeHeaderSet(const std::map<std::string, std::string>& header_set, | 42 bool EncodeHeaderSet(const std::map<std::string, std::string>& header_set, |
| 43 std::string* output); | 43 std::string* output); |
| 44 | 44 |
| 45 // Encodes the given header set into the given string. Only non-indexed | 45 // Encodes the given header set into the given string. Only non-indexed |
| 46 // literal representations are emitted, bypassing the header table. Huffman | 46 // literal representations are emitted, bypassing the header table. Huffman |
| 47 // coding is also not used. Returns whether the encoding was successful. | 47 // coding is also not used. Returns whether the encoding was successful. |
| 48 // TODO(jgraettinger): Enable Huffman coding once the table as stablized. | |
| 49 bool EncodeHeaderSetWithoutCompression( | 48 bool EncodeHeaderSetWithoutCompression( |
| 50 const std::map<std::string, std::string>& header_set, | 49 const std::map<std::string, std::string>& header_set, |
| 51 std::string* output); | 50 std::string* output); |
| 52 | 51 |
| 53 // Called upon a change to SETTINGS_HEADER_TABLE_SIZE. Specifically, this | 52 // Called upon a change to SETTINGS_HEADER_TABLE_SIZE. Specifically, this |
| 54 // 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 |
| 55 // SETTINGS_HEADER_TABLE_SIZE update from the remote decoding endpoint. | 54 // SETTINGS_HEADER_TABLE_SIZE update from the remote decoding endpoint. |
| 56 void ApplyHeaderTableSizeSetting(size_t size_setting) { | 55 void ApplyHeaderTableSizeSetting(size_t size_setting) { |
| 57 header_table_.SetSettingsHeaderTableSize(size_setting); | 56 header_table_.SetSettingsHeaderTableSize(size_setting); |
| 58 } | 57 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Externally-owned, nullable storage for character counts of literals. | 95 // Externally-owned, nullable storage for character counts of literals. |
| 97 std::vector<size_t>* char_counts_; | 96 std::vector<size_t>* char_counts_; |
| 98 size_t* total_char_counts_; | 97 size_t* total_char_counts_; |
| 99 | 98 |
| 100 DISALLOW_COPY_AND_ASSIGN(HpackEncoder); | 99 DISALLOW_COPY_AND_ASSIGN(HpackEncoder); |
| 101 }; | 100 }; |
| 102 | 101 |
| 103 } // namespace net | 102 } // namespace net |
| 104 | 103 |
| 105 #endif // NET_SPDY_HPACK_ENCODER_H_ | 104 #endif // NET_SPDY_HPACK_ENCODER_H_ |
| OLD | NEW |