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

Unified Diff: net/spdy/spdy_header_block.cc

Issue 2102253003: Make SpdyHeaderBlock non-copyable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iOS fix. Created 4 years, 6 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/spdy_header_block.h ('k') | net/spdy/spdy_header_block_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_header_block.cc
diff --git a/net/spdy/spdy_header_block.cc b/net/spdy/spdy_header_block.cc
index 61ca9af575137bca631676c803694354ec424219..09640c83ed6fda3f8e51e95e08030c16921bf468 100644
--- a/net/spdy/spdy_header_block.cc
+++ b/net/spdy/spdy_header_block.cc
@@ -120,13 +120,6 @@ SpdyHeaderBlock::StringPieceProxy::operator StringPiece() const {
SpdyHeaderBlock::SpdyHeaderBlock() : storage_(new Storage) {}
-SpdyHeaderBlock::SpdyHeaderBlock(const SpdyHeaderBlock& other)
- : storage_(new Storage) {
- for (auto iter : other) {
- AppendHeader(iter.first, iter.second);
- }
-}
-
SpdyHeaderBlock::SpdyHeaderBlock(SpdyHeaderBlock&& other)
: storage_(std::move(other.storage_)) {
// |block_| is linked_hash_map, which does not have move constructor.
@@ -135,14 +128,6 @@ SpdyHeaderBlock::SpdyHeaderBlock(SpdyHeaderBlock&& other)
SpdyHeaderBlock::~SpdyHeaderBlock() {}
-SpdyHeaderBlock& SpdyHeaderBlock::operator=(const SpdyHeaderBlock& other) {
- clear();
- for (auto iter : other) {
- AppendHeader(iter.first, iter.second);
- }
- return *this;
-}
-
SpdyHeaderBlock& SpdyHeaderBlock::operator=(SpdyHeaderBlock&& other) {
storage_ = std::move(other.storage_);
// |block_| is linked_hash_map, which does not have move assignment
@@ -151,6 +136,14 @@ SpdyHeaderBlock& SpdyHeaderBlock::operator=(SpdyHeaderBlock&& other) {
return *this;
}
+SpdyHeaderBlock SpdyHeaderBlock::Clone() const {
+ SpdyHeaderBlock copy;
+ for (auto iter : *this) {
+ copy.AppendHeader(iter.first, iter.second);
+ }
+ return copy;
+}
+
bool SpdyHeaderBlock::operator==(const SpdyHeaderBlock& other) const {
return size() == other.size() && std::equal(begin(), end(), other.begin());
}
« no previous file with comments | « net/spdy/spdy_header_block.h ('k') | net/spdy/spdy_header_block_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698