Index: net/spdy/hpack_header_table.cc |
diff --git a/net/spdy/hpack_header_table.cc b/net/spdy/hpack_header_table.cc |
index a7da21bff44244b22057e96265e19b32633ac3e1..0b5f2f089a6e74917f0c451830739aa3d0d6d5d4 100644 |
--- a/net/spdy/hpack_header_table.cc |
+++ b/net/spdy/hpack_header_table.cc |
@@ -32,66 +32,66 @@ struct StaticEntry { |
{ name, arraysize(name) - 1, value, arraysize(value) - 1 } |
const StaticEntry kStaticTable[] = { |
- STATIC_ENTRY(":authority" , ""), // 1 |
- STATIC_ENTRY(":method" , "GET"), // 2 |
- STATIC_ENTRY(":method" , "POST"), // 3 |
- STATIC_ENTRY(":path" , "/"), // 4 |
- STATIC_ENTRY(":path" , "/index.html"), // 5 |
- STATIC_ENTRY(":scheme" , "http"), // 6 |
- STATIC_ENTRY(":scheme" , "https"), // 7 |
- STATIC_ENTRY(":status" , "200"), // 8 |
- STATIC_ENTRY(":status" , "500"), // 9 |
- STATIC_ENTRY(":status" , "404"), // 10 |
- STATIC_ENTRY(":status" , "403"), // 11 |
- STATIC_ENTRY(":status" , "400"), // 12 |
- STATIC_ENTRY(":status" , "401"), // 13 |
- STATIC_ENTRY("accept-charset" , ""), // 14 |
- STATIC_ENTRY("accept-encoding" , ""), // 15 |
- STATIC_ENTRY("accept-language" , ""), // 16 |
- STATIC_ENTRY("accept-ranges" , ""), // 17 |
- STATIC_ENTRY("accept" , ""), // 18 |
- STATIC_ENTRY("access-control-allow-origin" , ""), // 19 |
- STATIC_ENTRY("age" , ""), // 20 |
- STATIC_ENTRY("allow" , ""), // 21 |
- STATIC_ENTRY("authorization" , ""), // 22 |
- STATIC_ENTRY("cache-control" , ""), // 23 |
- STATIC_ENTRY("content-disposition" , ""), // 24 |
- STATIC_ENTRY("content-encoding" , ""), // 25 |
- STATIC_ENTRY("content-language" , ""), // 26 |
- STATIC_ENTRY("content-length" , ""), // 27 |
- STATIC_ENTRY("content-location" , ""), // 28 |
- STATIC_ENTRY("content-range" , ""), // 29 |
- STATIC_ENTRY("content-type" , ""), // 30 |
- STATIC_ENTRY("cookie" , ""), // 31 |
- STATIC_ENTRY("date" , ""), // 32 |
- STATIC_ENTRY("etag" , ""), // 33 |
- STATIC_ENTRY("expect" , ""), // 34 |
- STATIC_ENTRY("expires" , ""), // 35 |
- STATIC_ENTRY("from" , ""), // 36 |
- STATIC_ENTRY("host" , ""), // 37 |
- STATIC_ENTRY("if-match" , ""), // 38 |
- STATIC_ENTRY("if-modified-since" , ""), // 39 |
- STATIC_ENTRY("if-none-match" , ""), // 40 |
- STATIC_ENTRY("if-range" , ""), // 41 |
- STATIC_ENTRY("if-unmodified-since" , ""), // 42 |
- STATIC_ENTRY("last-modified" , ""), // 43 |
- STATIC_ENTRY("link" , ""), // 44 |
- STATIC_ENTRY("location" , ""), // 45 |
- STATIC_ENTRY("max-forwards" , ""), // 46 |
- STATIC_ENTRY("proxy-authenticate" , ""), // 47 |
- STATIC_ENTRY("proxy-authorization" , ""), // 48 |
- STATIC_ENTRY("range" , ""), // 49 |
- STATIC_ENTRY("referer" , ""), // 50 |
- STATIC_ENTRY("refresh" , ""), // 51 |
- STATIC_ENTRY("retry-after" , ""), // 52 |
- STATIC_ENTRY("server" , ""), // 53 |
- STATIC_ENTRY("set-cookie" , ""), // 54 |
- STATIC_ENTRY("strict-transport-security" , ""), // 55 |
- STATIC_ENTRY("transfer-encoding" , ""), // 56 |
- STATIC_ENTRY("user-agent" , ""), // 57 |
- STATIC_ENTRY("vary" , ""), // 58 |
- STATIC_ENTRY("via" , ""), // 59 |
- STATIC_ENTRY("www-authenticate" , ""), // 60 |
+ STATIC_ENTRY(":authority", ""), // 1 |
+ STATIC_ENTRY(":method", "GET"), // 2 |
+ STATIC_ENTRY(":method", "POST"), // 3 |
+ STATIC_ENTRY(":path", "/"), // 4 |
+ STATIC_ENTRY(":path", "/index.html"), // 5 |
+ STATIC_ENTRY(":scheme", "http"), // 6 |
+ STATIC_ENTRY(":scheme", "https"), // 7 |
+ STATIC_ENTRY(":status", "200"), // 8 |
+ STATIC_ENTRY(":status", "500"), // 9 |
+ STATIC_ENTRY(":status", "404"), // 10 |
+ STATIC_ENTRY(":status", "403"), // 11 |
+ STATIC_ENTRY(":status", "400"), // 12 |
+ STATIC_ENTRY(":status", "401"), // 13 |
+ STATIC_ENTRY("accept-charset", ""), // 14 |
+ STATIC_ENTRY("accept-encoding", ""), // 15 |
+ STATIC_ENTRY("accept-language", ""), // 16 |
+ STATIC_ENTRY("accept-ranges", ""), // 17 |
+ STATIC_ENTRY("accept", ""), // 18 |
+ STATIC_ENTRY("access-control-allow-origin", ""), // 19 |
+ STATIC_ENTRY("age", ""), // 20 |
+ STATIC_ENTRY("allow", ""), // 21 |
+ STATIC_ENTRY("authorization", ""), // 22 |
+ STATIC_ENTRY("cache-control", ""), // 23 |
+ STATIC_ENTRY("content-disposition", ""), // 24 |
+ STATIC_ENTRY("content-encoding", ""), // 25 |
+ STATIC_ENTRY("content-language", ""), // 26 |
+ STATIC_ENTRY("content-length", ""), // 27 |
+ STATIC_ENTRY("content-location", ""), // 28 |
+ STATIC_ENTRY("content-range", ""), // 29 |
+ STATIC_ENTRY("content-type", ""), // 30 |
+ STATIC_ENTRY("cookie", ""), // 31 |
+ STATIC_ENTRY("date", ""), // 32 |
+ STATIC_ENTRY("etag", ""), // 33 |
+ STATIC_ENTRY("expect", ""), // 34 |
+ STATIC_ENTRY("expires", ""), // 35 |
+ STATIC_ENTRY("from", ""), // 36 |
+ STATIC_ENTRY("host", ""), // 37 |
+ STATIC_ENTRY("if-match", ""), // 38 |
+ STATIC_ENTRY("if-modified-since", ""), // 39 |
+ STATIC_ENTRY("if-none-match", ""), // 40 |
+ STATIC_ENTRY("if-range", ""), // 41 |
+ STATIC_ENTRY("if-unmodified-since", ""), // 42 |
+ STATIC_ENTRY("last-modified", ""), // 43 |
+ STATIC_ENTRY("link", ""), // 44 |
+ STATIC_ENTRY("location", ""), // 45 |
+ STATIC_ENTRY("max-forwards", ""), // 46 |
+ STATIC_ENTRY("proxy-authenticate", ""), // 47 |
+ STATIC_ENTRY("proxy-authorization", ""), // 48 |
+ STATIC_ENTRY("range", ""), // 49 |
+ STATIC_ENTRY("referer", ""), // 50 |
+ STATIC_ENTRY("refresh", ""), // 51 |
+ STATIC_ENTRY("retry-after", ""), // 52 |
+ STATIC_ENTRY("server", ""), // 53 |
+ STATIC_ENTRY("set-cookie", ""), // 54 |
+ STATIC_ENTRY("strict-transport-security", ""), // 55 |
+ STATIC_ENTRY("transfer-encoding", ""), // 56 |
+ STATIC_ENTRY("user-agent", ""), // 57 |
+ STATIC_ENTRY("vary", ""), // 58 |
+ STATIC_ENTRY("via", ""), // 59 |
+ STATIC_ENTRY("www-authenticate", ""), // 60 |
}; |
#undef STATIC_ENTRY |
@@ -105,20 +105,21 @@ HpackHeaderTable::HpackHeaderTable() |
total_insertions_(0), |
dynamic_entries_count_(0) { |
for (const StaticEntry* it = kStaticTable; |
- it != kStaticTable + arraysize(kStaticTable); ++it) { |
- static_entries_.push_back( |
- HpackEntry(StringPiece(it->name, it->name_len), |
- StringPiece(it->value, it->value_len), |
- true, // is_static |
- total_insertions_, |
- &dynamic_entries_count_)); |
+ it != kStaticTable + arraysize(kStaticTable); |
+ ++it) { |
+ static_entries_.push_back(HpackEntry(StringPiece(it->name, it->name_len), |
+ StringPiece(it->value, it->value_len), |
+ true, // is_static |
+ total_insertions_, |
+ &dynamic_entries_count_)); |
CHECK(index_.insert(&static_entries_.back()).second); |
++total_insertions_; |
} |
} |
-HpackHeaderTable::~HpackHeaderTable() {} |
+HpackHeaderTable::~HpackHeaderTable() { |
+} |
HpackEntry* HpackHeaderTable::GetByIndex(size_t index) { |
if (index == 0) { |
@@ -195,7 +196,8 @@ size_t HpackHeaderTable::EvictionCountForEntry(StringPiece name, |
size_t HpackHeaderTable::EvictionCountToReclaim(size_t reclaim_size) const { |
size_t count = 0; |
for (EntryTable::const_reverse_iterator it = dynamic_entries_.rbegin(); |
- it != dynamic_entries_.rend() && reclaim_size != 0; ++it, ++count) { |
+ it != dynamic_entries_.rend() && reclaim_size != 0; |
+ ++it, ++count) { |
reclaim_size -= std::min(reclaim_size, it->Size()); |
} |
return count; |
@@ -243,7 +245,8 @@ HpackEntry* HpackHeaderTable::TryAddEntry(StringPiece name, StringPiece value) { |
void HpackHeaderTable::ClearReferenceSet() { |
for (HpackEntry::OrderedSet::iterator it = reference_set_.begin(); |
- it != reference_set_.end(); ++it) { |
+ it != reference_set_.end(); |
+ ++it) { |
(*it)->set_state(0); |
} |
reference_set_.clear(); |
@@ -266,17 +269,20 @@ bool HpackHeaderTable::Toggle(HpackEntry* entry) { |
void HpackHeaderTable::DebugLogTableState() const { |
DVLOG(2) << "Reference Set:"; |
for (HpackEntry::OrderedSet::const_iterator it = reference_set_.begin(); |
- it != reference_set_.end(); ++it) { |
+ it != reference_set_.end(); |
+ ++it) { |
DVLOG(2) << " " << (*it)->GetDebugString(); |
} |
DVLOG(2) << "Dynamic table:"; |
for (EntryTable::const_iterator it = dynamic_entries_.begin(); |
- it != dynamic_entries_.end(); ++it) { |
+ it != dynamic_entries_.end(); |
+ ++it) { |
DVLOG(2) << " " << it->GetDebugString(); |
} |
DVLOG(2) << "Full Index:"; |
for (HpackEntry::OrderedSet::const_iterator it = index_.begin(); |
- it != index_.end(); ++it) { |
+ it != index_.end(); |
+ ++it) { |
DVLOG(2) << " " << (*it)->GetDebugString(); |
} |
} |