| 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 <vector> | 10 #include <vector> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Sets externally-owned storage for aggregating character counts of emitted | 59 // Sets externally-owned storage for aggregating character counts of emitted |
| 60 // literal representations. | 60 // literal representations. |
| 61 void SetCharCountsStorage(std::vector<size_t>* char_counts, | 61 void SetCharCountsStorage(std::vector<size_t>* char_counts, |
| 62 size_t* total_char_counts); | 62 size_t* total_char_counts); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 typedef std::pair<base::StringPiece, base::StringPiece> Representation; | 65 typedef std::pair<base::StringPiece, base::StringPiece> Representation; |
| 66 typedef std::vector<Representation> Representations; | 66 typedef std::vector<Representation> Representations; |
| 67 | 67 |
| 68 // Emits a static/dynamic indexed representation (Section 7.1). | 68 // Emits a static/dynamic indexed representation (Section 7.1). |
| 69 void EmitIndex(HpackEntry* entry); | 69 void EmitIndex(const HpackEntry* entry); |
| 70 | 70 |
| 71 // Emits a literal representation (Section 7.2). | 71 // Emits a literal representation (Section 7.2). |
| 72 void EmitIndexedLiteral(const Representation& representation); | 72 void EmitIndexedLiteral(const Representation& representation); |
| 73 void EmitNonIndexedLiteral(const Representation& representation); | 73 void EmitNonIndexedLiteral(const Representation& representation); |
| 74 void EmitLiteral(const Representation& representation); | 74 void EmitLiteral(const Representation& representation); |
| 75 | 75 |
| 76 // Emits a Huffman or identity string (whichever is smaller). | 76 // Emits a Huffman or identity string (whichever is smaller). |
| 77 void EmitString(base::StringPiece str); | 77 void EmitString(base::StringPiece str); |
| 78 | 78 |
| 79 void UpdateCharacterCounts(base::StringPiece str); | 79 void UpdateCharacterCounts(base::StringPiece str); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 91 // Externally-owned, nullable storage for character counts of literals. | 91 // Externally-owned, nullable storage for character counts of literals. |
| 92 std::vector<size_t>* char_counts_; | 92 std::vector<size_t>* char_counts_; |
| 93 size_t* total_char_counts_; | 93 size_t* total_char_counts_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(HpackEncoder); | 95 DISALLOW_COPY_AND_ASSIGN(HpackEncoder); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace net | 98 } // namespace net |
| 99 | 99 |
| 100 #endif // NET_SPDY_HPACK_ENCODER_H_ | 100 #endif // NET_SPDY_HPACK_ENCODER_H_ |
| OLD | NEW |