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

Side by Side Diff: net/tools/quic/quic_http_response_cache.h

Issue 2881423002: Migrate StringPiece::CopyToString to string::assign. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef NET_TOOLS_QUIC_QUIC_HTTP_RESPONSE_CACHE_H_ 5 #ifndef NET_TOOLS_QUIC_QUIC_HTTP_RESPONSE_CACHE_H_
6 #define NET_TOOLS_QUIC_QUIC_HTTP_RESPONSE_CACHE_H_ 6 #define NET_TOOLS_QUIC_QUIC_HTTP_RESPONSE_CACHE_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const SpdyHeaderBlock& trailers() const { return trailers_; } 58 const SpdyHeaderBlock& trailers() const { return trailers_; }
59 const QuicStringPiece body() const { return QuicStringPiece(body_); } 59 const QuicStringPiece body() const { return QuicStringPiece(body_); }
60 60
61 void set_response_type(SpecialResponseType response_type) { 61 void set_response_type(SpecialResponseType response_type) {
62 response_type_ = response_type; 62 response_type_ = response_type;
63 } 63 }
64 void set_headers(SpdyHeaderBlock headers) { headers_ = std::move(headers); } 64 void set_headers(SpdyHeaderBlock headers) { headers_ = std::move(headers); }
65 void set_trailers(SpdyHeaderBlock trailers) { 65 void set_trailers(SpdyHeaderBlock trailers) {
66 trailers_ = std::move(trailers); 66 trailers_ = std::move(trailers);
67 } 67 }
68 void set_body(QuicStringPiece body) { body.CopyToString(&body_); } 68 void set_body(QuicStringPiece body) {
69 body_.assign(body.data(), body.size());
70 }
69 71
70 private: 72 private:
71 SpecialResponseType response_type_; 73 SpecialResponseType response_type_;
72 SpdyHeaderBlock headers_; 74 SpdyHeaderBlock headers_;
73 SpdyHeaderBlock trailers_; 75 SpdyHeaderBlock trailers_;
74 std::string body_; 76 std::string body_;
75 77
76 DISALLOW_COPY_AND_ASSIGN(Response); 78 DISALLOW_COPY_AND_ASSIGN(Response);
77 }; 79 };
78 80
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // Protects against concurrent access from test threads setting responses, and 216 // Protects against concurrent access from test threads setting responses, and
215 // server threads accessing those responses. 217 // server threads accessing those responses.
216 mutable QuicMutex response_mutex_; 218 mutable QuicMutex response_mutex_;
217 219
218 DISALLOW_COPY_AND_ASSIGN(QuicHttpResponseCache); 220 DISALLOW_COPY_AND_ASSIGN(QuicHttpResponseCache);
219 }; 221 };
220 222
221 } // namespace net 223 } // namespace net
222 224
223 #endif // NET_TOOLS_QUIC_QUIC_HTTP_RESPONSE_CACHE_H_ 225 #endif // NET_TOOLS_QUIC_QUIC_HTTP_RESPONSE_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698