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

Side by Side Diff: net/spdy/hpack/hpack_static_table.cc

Issue 1458163002: Remove |using base::StringPiece| from net/spdy header files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « net/spdy/hpack/hpack_header_table.h ('k') | net/spdy/spdy_alt_svc_wire_format.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/spdy/hpack/hpack_static_table.h" 5 #include "net/spdy/hpack/hpack_static_table.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/spdy/hpack/hpack_constants.h" 8 #include "net/spdy/hpack/hpack_constants.h"
9 #include "net/spdy/hpack/hpack_entry.h" 9 #include "net/spdy/hpack/hpack_entry.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 HpackStaticTable::HpackStaticTable() {} 13 HpackStaticTable::HpackStaticTable() {}
14 14
15 HpackStaticTable::~HpackStaticTable() {} 15 HpackStaticTable::~HpackStaticTable() {}
16 16
17 void HpackStaticTable::Initialize(const HpackStaticEntry* static_entry_table, 17 void HpackStaticTable::Initialize(const HpackStaticEntry* static_entry_table,
18 size_t static_entry_count) { 18 size_t static_entry_count) {
19 CHECK(!IsInitialized()); 19 CHECK(!IsInitialized());
20 20
21 int total_insertions = 0; 21 int total_insertions = 0;
22 for (const HpackStaticEntry* it = static_entry_table; 22 for (const HpackStaticEntry* it = static_entry_table;
23 it != static_entry_table + static_entry_count; ++it) { 23 it != static_entry_table + static_entry_count; ++it) {
24 static_entries_.push_back(HpackEntry(StringPiece(it->name, it->name_len), 24 static_entries_.push_back(
25 StringPiece(it->value, it->value_len), 25 HpackEntry(base::StringPiece(it->name, it->name_len),
26 true, // is_static 26 base::StringPiece(it->value, it->value_len),
27 total_insertions)); 27 true, // is_static
28 total_insertions));
28 CHECK(static_index_.insert(&static_entries_.back()).second); 29 CHECK(static_index_.insert(&static_entries_.back()).second);
29 30
30 ++total_insertions; 31 ++total_insertions;
31 } 32 }
32 } 33 }
33 34
34 bool HpackStaticTable::IsInitialized() const { 35 bool HpackStaticTable::IsInitialized() const {
35 return !static_entries_.empty(); 36 return !static_entries_.empty();
36 } 37 }
37 38
38 } // namespace net 39 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack/hpack_header_table.h ('k') | net/spdy/spdy_alt_svc_wire_format.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698