Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: net/spdy/hpack_entry.cc

Issue 290003006: Land recent SPDY changes (through 67282679) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on nullptr => NULL Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/hpack_entry.h ('k') | net/spdy/hpack_entry_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack_entry.cc
diff --git a/net/spdy/hpack_entry.cc b/net/spdy/hpack_entry.cc
index e62c79923727497c18940159bee7c9e9fb44ecbb..f56f181deb7533e807db33955951c2715dd452b8 100644
--- a/net/spdy/hpack_entry.cc
+++ b/net/spdy/hpack_entry.cc
@@ -14,62 +14,33 @@ using base::StringPiece;
const size_t HpackEntry::kSizeOverhead = 32;
-bool HpackEntry::Comparator::operator() (
- const HpackEntry* lhs, const HpackEntry* rhs) const {
- int result = lhs->name().compare(rhs->name());
- if (result != 0)
- return result < 0;
- result = lhs->value().compare(rhs->value());
- if (result != 0)
- return result < 0;
- DCHECK(lhs == rhs || lhs->Index() != rhs->Index());
- return lhs->Index() < rhs->Index();
-}
-
HpackEntry::HpackEntry(StringPiece name,
StringPiece value,
bool is_static,
- size_t insertion_index,
- const size_t* total_table_insertions_or_current_size)
+ size_t insertion_index)
: name_(name.data(), name.size()),
value_(value.data(), value.size()),
- is_static_(is_static),
- state_(0),
insertion_index_(insertion_index),
- total_insertions_or_size_(total_table_insertions_or_current_size) {
- CHECK_NE(total_table_insertions_or_current_size,
- static_cast<const size_t*>(NULL));
+ state_(0),
+ type_(is_static ? STATIC : DYNAMIC) {
}
HpackEntry::HpackEntry(StringPiece name, StringPiece value)
: name_(name.data(), name.size()),
value_(value.data(), value.size()),
- is_static_(false),
- state_(0),
insertion_index_(0),
- total_insertions_or_size_(NULL) {
+ state_(0),
+ type_(LOOKUP) {
}
HpackEntry::HpackEntry()
- : is_static_(false),
+ : insertion_index_(0),
state_(0),
- insertion_index_(0),
- total_insertions_or_size_(NULL) {
+ type_(LOOKUP) {
}
HpackEntry::~HpackEntry() {}
-size_t HpackEntry::Index() const {
- if (total_insertions_or_size_ == NULL) {
- // This is a lookup instance.
- return 0;
- } else if (IsStatic()) {
- return 1 + insertion_index_ + *total_insertions_or_size_;
- } else {
- return *total_insertions_or_size_ - insertion_index_;
- }
-}
-
// static
size_t HpackEntry::Size(StringPiece name, StringPiece value) {
return name.size() + value.size() + kSizeOverhead;
« no previous file with comments | « net/spdy/hpack_entry.h ('k') | net/spdy/hpack_entry_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698