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

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

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 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 unified diff | Download patch
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 "base/time/time.h" 7 #include "base/time/time.h"
8 #include "net/base/completion_callback.h" 8 #include "net/base/completion_callback.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/cert/cert_verify_result.h" 10 #include "net/cert/cert_verify_result.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 QuicAsyncStatus VerifyProof(const string& hostname, 45 QuicAsyncStatus VerifyProof(const string& hostname,
46 const uint16_t port, 46 const uint16_t port,
47 const string& server_config, 47 const string& server_config,
48 QuicVersion quic_version, 48 QuicVersion quic_version,
49 StringPiece chlo_hash, 49 StringPiece chlo_hash,
50 const vector<string>& certs, 50 const vector<string>& certs,
51 const string& cert_sct, 51 const string& cert_sct,
52 const string& signature, 52 const string& signature,
53 const ProofVerifyContext* context, 53 const ProofVerifyContext* context,
54 string* error_details, 54 string* error_details,
55 scoped_ptr<ProofVerifyDetails>* details, 55 std::unique_ptr<ProofVerifyDetails>* details,
56 ProofVerifierCallback* callback) override { 56 ProofVerifierCallback* callback) override {
57 common_name_.clear(); 57 common_name_.clear();
58 if (certs.empty()) { 58 if (certs.empty()) {
59 return QUIC_FAILURE; 59 return QUIC_FAILURE;
60 } 60 }
61 61
62 // Convert certs to X509Certificate. 62 // Convert certs to X509Certificate.
63 vector<StringPiece> cert_pieces(certs.size()); 63 vector<StringPiece> cert_pieces(certs.size());
64 for (unsigned i = 0; i < certs.size(); i++) { 64 for (unsigned i = 0; i < certs.size(); i++) {
65 cert_pieces[i] = StringPiece(certs[i]); 65 cert_pieces[i] = StringPiece(certs[i]);
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 if (!url.host().empty()) { 304 if (!url.host().empty()) {
305 client_->set_server_id(QuicServerId(url.host(), url.EffectiveIntPort(), 305 client_->set_server_id(QuicServerId(url.host(), url.EffectiveIntPort(),
306 PRIVACY_MODE_DISABLED)); 306 PRIVACY_MODE_DISABLED));
307 } 307 }
308 } 308 }
309 309
310 // TODO(rtenneti): Add support for HTTPMessage::body_chunks(). 310 // TODO(rtenneti): Add support for HTTPMessage::body_chunks().
311 // CHECK(message.body_chunks().empty()) 311 // CHECK(message.body_chunks().empty())
312 // << "HTTPMessage::body_chunks not supported"; 312 // << "HTTPMessage::body_chunks not supported";
313 313
314 scoped_ptr<BalsaHeaders> munged_headers(MungeHeaders(message.headers())); 314 std::unique_ptr<BalsaHeaders> munged_headers(MungeHeaders(message.headers()));
315 ssize_t ret = GetOrCreateStreamAndSendRequest( 315 ssize_t ret = GetOrCreateStreamAndSendRequest(
316 (munged_headers.get() ? munged_headers.get() : message.headers()), 316 (munged_headers.get() ? munged_headers.get() : message.headers()),
317 message.body(), message.has_complete_message(), nullptr); 317 message.body(), message.has_complete_message(), nullptr);
318 WaitForWriteToFlush(); 318 WaitForWriteToFlush();
319 return ret; 319 return ret;
320 } 320 }
321 321
322 ssize_t QuicTestClient::SendData(const string& data, bool last_data) { 322 ssize_t QuicTestClient::SendData(const string& data, bool last_data) {
323 return SendData(data, last_data, nullptr); 323 return SendData(data, last_data, nullptr);
324 } 324 }
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 CHECK(message); 667 CHECK(message);
668 message->headers()->SetRequestVersion( 668 message->headers()->SetRequestVersion(
669 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); 669 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1));
670 message->headers()->SetRequestMethod( 670 message->headers()->SetRequestMethod(
671 HTTPMessage::MethodToString(HttpConstants::GET)); 671 HTTPMessage::MethodToString(HttpConstants::GET));
672 message->headers()->SetRequestUri(uri); 672 message->headers()->SetRequestUri(uri);
673 } 673 }
674 674
675 } // namespace test 675 } // namespace test
676 } // namespace net 676 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/test_tools/quic_test_client.h ('k') | net/tools/quic/test_tools/quic_test_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698