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

Side by Side Diff: net/tools/quic/quic_client_bin.cc

Issue 1290243007: Shift URLRequestContextStorage over to taking scoped_ptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Paul_BuilderGrab
Patch Set: Sync'd to revision p349162. Created 5 years, 3 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/spdy/spdy_test_util_common.cc ('k') | net/tools/quic/quic_simple_client_bin.cc » ('j') | 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 // A binary wrapper for QuicClient. 5 // A binary wrapper for QuicClient.
6 // Connects to a host using QUIC, sends a request to the provided URL, and 6 // Connects to a host using QUIC, sends a request to the provided URL, and
7 // displays the response. 7 // displays the response.
8 // 8 //
9 // Some usage examples: 9 // Some usage examples:
10 // 10 //
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 versions.clear(); 209 versions.clear();
210 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version)); 210 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version));
211 } 211 }
212 net::tools::QuicClient client(net::IPEndPoint(ip_addr, FLAGS_port), server_id, 212 net::tools::QuicClient client(net::IPEndPoint(ip_addr, FLAGS_port), server_id,
213 versions, &epoll_server); 213 versions, &epoll_server);
214 scoped_ptr<CertVerifier> cert_verifier; 214 scoped_ptr<CertVerifier> cert_verifier;
215 scoped_ptr<TransportSecurityState> transport_security_state; 215 scoped_ptr<TransportSecurityState> transport_security_state;
216 client.set_initial_max_packet_length( 216 client.set_initial_max_packet_length(
217 FLAGS_initial_mtu != 0 ? FLAGS_initial_mtu : net::kDefaultMaxPacketSize); 217 FLAGS_initial_mtu != 0 ? FLAGS_initial_mtu : net::kDefaultMaxPacketSize);
218 // For secure QUIC we need to verify the cert chain. 218 // For secure QUIC we need to verify the cert chain.
219 cert_verifier.reset(CertVerifier::CreateDefault()); 219 cert_verifier = CertVerifier::CreateDefault();
220 transport_security_state.reset(new TransportSecurityState); 220 transport_security_state.reset(new TransportSecurityState);
221 client.SetProofVerifier(new ProofVerifierChromium( 221 client.SetProofVerifier(new ProofVerifierChromium(
222 cert_verifier.get(), nullptr, transport_security_state.get())); 222 cert_verifier.get(), nullptr, transport_security_state.get()));
223 if (!client.Initialize()) { 223 if (!client.Initialize()) {
224 cerr << "Failed to initialize client." << endl; 224 cerr << "Failed to initialize client." << endl;
225 return 1; 225 return 1;
226 } 226 }
227 if (!client.Connect()) { 227 if (!client.Connect()) {
228 net::QuicErrorCode error = client.session()->error(); 228 net::QuicErrorCode error = client.session()->error();
229 if (FLAGS_version_mismatch_ok && error == net::QUIC_INVALID_VERSION) { 229 if (FLAGS_version_mismatch_ok && error == net::QUIC_INVALID_VERSION) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 return 0; 295 return 0;
296 } else { 296 } else {
297 cout << "Request failed (redirect " << response_code << ")." << endl; 297 cout << "Request failed (redirect " << response_code << ")." << endl;
298 return 1; 298 return 1;
299 } 299 }
300 } else { 300 } else {
301 cerr << "Request failed (" << response_code << ")." << endl; 301 cerr << "Request failed (" << response_code << ")." << endl;
302 return 1; 302 return 1;
303 } 303 }
304 } 304 }
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_util_common.cc ('k') | net/tools/quic/quic_simple_client_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698