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

Side by Side Diff: net/tools/quic/test_tools/quic_test_client.cc

Issue 2093553004: Reduce SpdyHeaderBlock copies with move semantics in shared code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove non-shared files (into a separate CL). 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 unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.cc ('k') | 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 #include "net/tools/quic/test_tools/quic_test_client.h" 5 #include "net/tools/quic/test_tools/quic_test_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility>
8 9
9 #include "base/time/time.h" 10 #include "base/time/time.h"
10 #include "net/base/completion_callback.h" 11 #include "net/base/completion_callback.h"
11 #include "net/base/net_errors.h" 12 #include "net/base/net_errors.h"
12 #include "net/cert/cert_verify_result.h" 13 #include "net/cert/cert_verify_result.h"
13 #include "net/cert/x509_certificate.h" 14 #include "net/cert/x509_certificate.h"
14 #include "net/quic/crypto/proof_verifier.h" 15 #include "net/quic/crypto/proof_verifier.h"
15 #include "net/quic/quic_flags.h" 16 #include "net/quic/quic_flags.h"
16 #include "net/quic/quic_server_id.h" 17 #include "net/quic/quic_server_id.h"
17 #include "net/quic/test_tools/quic_connection_peer.h" 18 #include "net/quic/test_tools/quic_connection_peer.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // We have tests which rely on sending a non-standards-compliant 272 // We have tests which rely on sending a non-standards-compliant
272 // T-E header. 273 // T-E header.
273 string encoding; 274 string encoding;
274 headers->GetAllOfHeaderAsString("transfer-encoding", &encoding); 275 headers->GetAllOfHeaderAsString("transfer-encoding", &encoding);
275 spdy_headers.insert(std::make_pair("transfer-encoding", encoding)); 276 spdy_headers.insert(std::make_pair("transfer-encoding", encoding));
276 } 277 }
277 if (static_cast<StringPiece>(spdy_headers[":authority"]).empty()) { 278 if (static_cast<StringPiece>(spdy_headers[":authority"]).empty()) {
278 // HTTP/2 requests should include the :authority pseudo hader. 279 // HTTP/2 requests should include the :authority pseudo hader.
279 spdy_headers[":authority"] = client_->server_id().host(); 280 spdy_headers[":authority"] = client_->server_id().host();
280 } 281 }
281 ret = stream->SendRequest(spdy_headers, body, fin); 282 ret = stream->SendRequest(std::move(spdy_headers), body, fin);
282 ++num_requests_; 283 ++num_requests_;
283 } else { 284 } else {
284 stream->WriteOrBufferBody(body.as_string(), fin, delegate); 285 stream->WriteOrBufferBody(body.as_string(), fin, delegate);
285 ret = body.length(); 286 ret = body.length();
286 } 287 }
287 if (FLAGS_enable_quic_stateless_reject_support) { 288 if (FLAGS_enable_quic_stateless_reject_support) {
288 BalsaHeaders* new_headers = nullptr; 289 BalsaHeaders* new_headers = nullptr;
289 if (headers) { 290 if (headers) {
290 new_headers = new BalsaHeaders; 291 new_headers = new BalsaHeaders;
291 new_headers->CopyFrom(*headers); 292 new_headers->CopyFrom(*headers);
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 CHECK(message); 670 CHECK(message);
670 message->headers()->SetRequestVersion( 671 message->headers()->SetRequestVersion(
671 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); 672 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1));
672 message->headers()->SetRequestMethod( 673 message->headers()->SetRequestMethod(
673 HTTPMessage::MethodToString(HttpConstants::GET)); 674 HTTPMessage::MethodToString(HttpConstants::GET));
674 message->headers()->SetRequestUri(uri); 675 message->headers()->SetRequestUri(uri);
675 } 676 }
676 677
677 } // namespace test 678 } // namespace test
678 } // namespace net 679 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698