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

Unified Diff: net/spdy/hpack/hpack_entry.cc

Issue 2832973003: Split net/spdy into core and chromium subdirectories. (Closed)
Patch Set: Fix some more build rules. Created 3 years, 8 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/hpack_entry.h ('k') | net/spdy/hpack/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/hpack_entry.cc
diff --git a/net/spdy/hpack/hpack_entry.cc b/net/spdy/hpack/hpack_entry.cc
deleted file mode 100644
index 582d55d209d06d84bdbf34ababc72a3c7c5d9651..0000000000000000000000000000000000000000
--- a/net/spdy/hpack/hpack_entry.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/spdy/hpack/hpack_entry.h"
-
-#include "base/logging.h"
-#include "base/strings/string_number_conversions.h"
-#include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
-
-namespace net {
-
-const size_t HpackEntry::kSizeOverhead = 32;
-
-HpackEntry::HpackEntry(SpdyStringPiece name,
- SpdyStringPiece value,
- bool is_static,
- size_t insertion_index)
- : name_(name.data(), name.size()),
- value_(value.data(), value.size()),
- name_ref_(name_),
- value_ref_(value_),
- insertion_index_(insertion_index),
- type_(is_static ? STATIC : DYNAMIC),
- time_added_(0) {}
-
-HpackEntry::HpackEntry(SpdyStringPiece name, SpdyStringPiece value)
- : name_ref_(name),
- value_ref_(value),
- insertion_index_(0),
- type_(LOOKUP),
- time_added_(0) {}
-
-HpackEntry::HpackEntry() : insertion_index_(0), type_(LOOKUP), time_added_(0) {}
-
-HpackEntry::HpackEntry(const HpackEntry& other)
- : insertion_index_(other.insertion_index_),
- type_(other.type_),
- time_added_(0) {
- if (type_ == LOOKUP) {
- name_ref_ = other.name_ref_;
- value_ref_ = other.value_ref_;
- } else {
- name_ = other.name_;
- value_ = other.value_;
- name_ref_ = SpdyStringPiece(name_.data(), name_.size());
- value_ref_ = SpdyStringPiece(value_.data(), value_.size());
- }
-}
-
-HpackEntry& HpackEntry::operator=(const HpackEntry& other) {
- insertion_index_ = other.insertion_index_;
- type_ = other.type_;
- if (type_ == LOOKUP) {
- name_ref_ = other.name_ref_;
- value_ref_ = other.value_ref_;
- return *this;
- }
- name_ = other.name_;
- value_ = other.value_;
- name_ref_ = SpdyStringPiece(name_.data(), name_.size());
- value_ref_ = SpdyStringPiece(value_.data(), value_.size());
- return *this;
-}
-
-HpackEntry::~HpackEntry() {}
-
-// static
-size_t HpackEntry::Size(SpdyStringPiece name, SpdyStringPiece value) {
- return name.size() + value.size() + kSizeOverhead;
-}
-
-size_t HpackEntry::Size() const {
- return Size(name(), value());
-}
-
-SpdyString HpackEntry::GetDebugString() const {
- return "{ name: \"" + SpdyString(name_ref_) + "\", value: \"" +
- SpdyString(value_ref_) +
- "\", index: " + base::SizeTToString(insertion_index_) +
- (IsStatic() ? " static" : (IsLookup() ? " lookup" : " dynamic")) +
- " }";
-}
-
-size_t HpackEntry::EstimateMemoryUsage() const {
- return SpdyEstimateMemoryUsage(name_) + SpdyEstimateMemoryUsage(value_);
-}
-
-} // namespace net
« no previous file with comments | « net/spdy/hpack/hpack_entry.h ('k') | net/spdy/hpack/hpack_entry_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698