Commit 811e9b19 authored by Dianna Hu's avatar Dianna Hu Committed by Commit Bot

Change NULL --> nullptr in net/spdy/core/hpack.

This CL lands server change 177311740 by clshepherd.

BUG=488484

Change-Id: I257a10f801e375453d38c05f9f6c84514782a5a6
Reviewed-on: https://chromium-review.googlesource.com/807145
Commit-Queue: Bence Béky <bnc@chromium.org>
Reviewed-by: default avatarBence Béky <bnc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521693}
parent fe0c929c
......@@ -445,7 +445,7 @@ TEST_P(HpackEncoderTest, PseudoHeadersFirst) {
}
TEST_P(HpackEncoderTest, CookieToCrumbs) {
test::HpackEncoderPeer peer(NULL);
test::HpackEncoderPeer peer(nullptr);
std::vector<SpdyStringPiece> out;
// Leading and trailing whitespace is consumed. A space after ';' is consumed.
......@@ -479,7 +479,7 @@ TEST_P(HpackEncoderTest, CookieToCrumbs) {
}
TEST_P(HpackEncoderTest, DecomposeRepresentation) {
test::HpackEncoderPeer peer(NULL);
test::HpackEncoderPeer peer(nullptr);
std::vector<SpdyStringPiece> out;
peer.DecomposeRepresentation("", &out);
......
......@@ -43,7 +43,7 @@ HpackHeaderTable::~HpackHeaderTable() = default;
const HpackEntry* HpackHeaderTable::GetByIndex(size_t index) {
if (index == 0) {
return NULL;
return nullptr;
}
index -= 1;
if (index < static_entries_.size()) {
......@@ -57,7 +57,7 @@ const HpackEntry* HpackHeaderTable::GetByIndex(size_t index) {
}
return result;
}
return NULL;
return nullptr;
}
const HpackEntry* HpackHeaderTable::GetByName(SpdyStringPiece name) {
......@@ -77,7 +77,7 @@ const HpackEntry* HpackHeaderTable::GetByName(SpdyStringPiece name) {
return result;
}
}
return NULL;
return nullptr;
}
const HpackEntry* HpackHeaderTable::GetByNameAndValue(SpdyStringPiece name,
......@@ -99,7 +99,7 @@ const HpackEntry* HpackHeaderTable::GetByNameAndValue(SpdyStringPiece name,
return result;
}
}
return NULL;
return nullptr;
}
size_t HpackHeaderTable::IndexOf(const HpackEntry* entry) const {
......@@ -192,7 +192,7 @@ const HpackEntry* HpackHeaderTable::TryAddEntry(SpdyStringPiece name,
// Entire table has been emptied, but there's still insufficient room.
DCHECK(dynamic_entries_.empty());
DCHECK_EQ(0u, size_);
return NULL;
return nullptr;
}
dynamic_entries_.push_front(HpackEntry(name, value,
false, // is_static
......
......@@ -109,7 +109,7 @@ class HpackHeaderTableTest : public ::testing::Test {
EXPECT_EQ(0, distance(begin, end));
const HpackEntry* entry = table_.TryAddEntry(it->name(), it->value());
EXPECT_NE(entry, static_cast<HpackEntry*>(NULL));
EXPECT_NE(entry, static_cast<HpackEntry*>(nullptr));
}
for (size_t i = 0; i != entries.size(); ++i) {
......@@ -225,7 +225,7 @@ TEST_F(HpackHeaderTableTest, EntryIndexing) {
EXPECT_EQ(entry7, table_.GetByName("key-2"));
EXPECT_EQ(entry2->name(),
table_.GetByName(first_static_entry->name())->name());
EXPECT_EQ(NULL, table_.GetByName("not-present"));
EXPECT_EQ(nullptr, table_.GetByName("not-present"));
// Querying by name & value returns the lowest-index matching entry among
// static entries, and the highest-index one among dynamic entries.
......@@ -238,8 +238,8 @@ TEST_F(HpackHeaderTableTest, EntryIndexing) {
first_static_entry->value()));
EXPECT_EQ(entry2,
table_.GetByNameAndValue(first_static_entry->name(), "Value Four"));
EXPECT_EQ(NULL, table_.GetByNameAndValue("key-1", "Not Present"));
EXPECT_EQ(NULL, table_.GetByNameAndValue("not-present", "Value One"));
EXPECT_EQ(nullptr, table_.GetByNameAndValue("key-1", "Not Present"));
EXPECT_EQ(nullptr, table_.GetByNameAndValue("not-present", "Value One"));
// Evict |entry1|. Queries for its name & value now return the static entry.
// |entry2| remains queryable.
......@@ -252,7 +252,7 @@ TEST_F(HpackHeaderTableTest, EntryIndexing) {
// Evict |entry2|. Queries by its name & value are not found.
peer_.Evict(1);
EXPECT_EQ(NULL,
EXPECT_EQ(nullptr,
table_.GetByNameAndValue(first_static_entry->name(), "Value Four"));
}
......@@ -394,7 +394,7 @@ TEST_F(HpackHeaderTableTest, TryAddTooLargeEntry) {
const HpackEntry* new_entry =
table_.TryAddEntry(long_entry.name(), long_entry.value());
EXPECT_EQ(new_entry, static_cast<HpackEntry*>(NULL));
EXPECT_EQ(new_entry, static_cast<HpackEntry*>(nullptr));
EXPECT_EQ(0u, peer_.dynamic_entries().size());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment