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_ENTRY_H_ | 5 #ifndef NET_SPDY_HPACK_ENTRY_H_ |
6 #define NET_SPDY_HPACK_ENTRY_H_ | 6 #define NET_SPDY_HPACK_ENTRY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // Used to compute the entry's index in the header table. | 67 // Used to compute the entry's index in the header table. |
68 size_t InsertionIndex() const { return insertion_index_; } | 68 size_t InsertionIndex() const { return insertion_index_; } |
69 | 69 |
70 // Returns the size of an entry as defined in 5.1. | 70 // Returns the size of an entry as defined in 5.1. |
71 static size_t Size(base::StringPiece name, base::StringPiece value); | 71 static size_t Size(base::StringPiece name, base::StringPiece value); |
72 size_t Size() const; | 72 size_t Size() const; |
73 | 73 |
74 std::string GetDebugString() const; | 74 std::string GetDebugString() const; |
75 | 75 |
| 76 int64_t time_added() const { return time_added_; } |
| 77 void set_time_added(int64_t now) { time_added_ = now; } |
| 78 |
76 private: | 79 private: |
77 enum EntryType { | 80 enum EntryType { |
78 LOOKUP, | 81 LOOKUP, |
79 DYNAMIC, | 82 DYNAMIC, |
80 STATIC, | 83 STATIC, |
81 }; | 84 }; |
82 | 85 |
83 // These members are not used for LOOKUP entries. | 86 // These members are not used for LOOKUP entries. |
84 std::string name_; | 87 std::string name_; |
85 std::string value_; | 88 std::string value_; |
86 | 89 |
87 // These members are always valid. For DYNAMIC and STATIC entries, they | 90 // These members are always valid. For DYNAMIC and STATIC entries, they |
88 // always point to |name_| and |value_|. | 91 // always point to |name_| and |value_|. |
89 base::StringPiece name_ref_; | 92 base::StringPiece name_ref_; |
90 base::StringPiece value_ref_; | 93 base::StringPiece value_ref_; |
91 | 94 |
92 // The entry's index in the total set of entries ever inserted into the header | 95 // The entry's index in the total set of entries ever inserted into the header |
93 // table. | 96 // table. |
94 size_t insertion_index_; | 97 size_t insertion_index_; |
95 | 98 |
96 EntryType type_; | 99 EntryType type_; |
| 100 |
| 101 // For HpackHeaderTable::DebugVisitorInterface |
| 102 int64_t time_added_; |
97 }; | 103 }; |
98 | 104 |
99 } // namespace net | 105 } // namespace net |
100 | 106 |
101 #endif // NET_SPDY_HPACK_ENTRY_H_ | 107 #endif // NET_SPDY_HPACK_ENTRY_H_ |
OLD | NEW |