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

Unified Diff: net/tools/quic/quic_in_memory_cache.h

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/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_in_memory_cache.h
diff --git a/net/tools/quic/quic_in_memory_cache.h b/net/tools/quic/quic_in_memory_cache.h
index 21477c3f40d461bc70d319b241593364e021d46b..2747c9303be7c29afb6e5adf385714cd6bb1d17b 100644
--- a/net/tools/quic/quic_in_memory_cache.h
+++ b/net/tools/quic/quic_in_memory_cache.h
@@ -45,7 +45,7 @@ class QuicInMemoryCache {
// comprising a response for the push request.
struct ServerPushInfo {
ServerPushInfo(GURL request_url,
- const SpdyHeaderBlock& headers,
+ SpdyHeaderBlock headers,
SpdyPriority priority,
std::string body);
ServerPushInfo(const ServerPushInfo& other);
@@ -75,8 +75,10 @@ class QuicInMemoryCache {
void set_response_type(SpecialResponseType response_type) {
response_type_ = response_type;
}
- void set_headers(const SpdyHeaderBlock& headers) { headers_ = headers; }
- void set_trailers(const SpdyHeaderBlock& trailers) { trailers_ = trailers; }
+ void set_headers(SpdyHeaderBlock headers) { headers_ = std::move(headers); }
+ void set_trailers(SpdyHeaderBlock trailers) {
+ trailers_ = std::move(trailers);
+ }
void set_body(base::StringPiece body) { body.CopyToString(&body_); }
private:
@@ -108,7 +110,7 @@ class QuicInMemoryCache {
base::StringPiece path() { return path_; }
void set_path(base::StringPiece path) { path_ = path; }
- SpdyHeaderBlock spdy_headers() { return spdy_headers_; }
+ const SpdyHeaderBlock& spdy_headers() { return spdy_headers_; }
base::StringPiece body() { return body_; }
@@ -167,15 +169,15 @@ class QuicInMemoryCache {
// Add a response to the cache.
void AddResponse(base::StringPiece host,
base::StringPiece path,
- const SpdyHeaderBlock& response_headers,
+ SpdyHeaderBlock response_headers,
base::StringPiece response_body);
// Add a response, with trailers, to the cache.
void AddResponse(base::StringPiece host,
base::StringPiece path,
- const SpdyHeaderBlock& response_headers,
+ SpdyHeaderBlock response_headers,
base::StringPiece response_body,
- const SpdyHeaderBlock& response_trailers);
+ SpdyHeaderBlock response_trailers);
// Simulate a special behavior at a particular path.
void AddSpecialResponse(base::StringPiece host,
@@ -206,9 +208,9 @@ class QuicInMemoryCache {
void AddResponseImpl(base::StringPiece host,
base::StringPiece path,
SpecialResponseType response_type,
- const SpdyHeaderBlock& response_headers,
+ SpdyHeaderBlock response_headers,
base::StringPiece response_body,
- const SpdyHeaderBlock& response_trailers);
+ SpdyHeaderBlock response_trailers);
std::string GetKey(base::StringPiece host, base::StringPiece path) const;
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698