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

Side by Side Diff: net/spdy/hpack_entry.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/spdy/hpack_entry.h"
6
7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h"
9 #include "net/spdy/hpack_string_util.h"
10
11 namespace net {
12
13 using base::StringPiece;
14
15 const size_t HpackEntry::kSizeOverhead = 32;
16
17 HpackEntry::HpackEntry(StringPiece name,
18 StringPiece value,
19 bool is_static,
20 size_t insertion_index)
21 : name_(name.data(), name.size()),
22 value_(value.data(), value.size()),
23 insertion_index_(insertion_index),
24 type_(is_static ? STATIC : DYNAMIC) {
25 }
26
27 HpackEntry::HpackEntry(StringPiece name, StringPiece value)
28 : name_(name.data(), name.size()),
29 value_(value.data(), value.size()),
30 insertion_index_(0),
31 type_(LOOKUP) {
32 }
33
34 HpackEntry::HpackEntry()
35 : insertion_index_(0),
36 type_(LOOKUP) {
37 }
38
39 HpackEntry::~HpackEntry() {}
40
41 // static
42 size_t HpackEntry::Size(StringPiece name, StringPiece value) {
43 return name.size() + value.size() + kSizeOverhead;
44 }
45 size_t HpackEntry::Size() const {
46 return Size(name(), value());
47 }
48
49 std::string HpackEntry::GetDebugString() const {
50 return "{ name: \"" + name_ +
51 "\", value: \"" + value_ +
52 "\", " + (IsStatic() ? "static" : "dynamic") + " }";
53 }
54
55 } // namespace net
OLDNEW
« 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