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

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

Issue 2101863004: net: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/end_to_end_test.cc ('k') | net/tools/quic/quic_simple_client.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 #include "net/tools/quic/quic_client.h" 5 #include "net/tools/quic/quic_client.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <netinet/in.h> 8 #include <netinet/in.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/epoll.h> 10 #include <sys/epoll.h>
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 StringPiece body, 284 StringPiece body,
285 bool fin) { 285 bool fin) {
286 QuicClientPushPromiseIndex::TryHandle* handle; 286 QuicClientPushPromiseIndex::TryHandle* handle;
287 QuicAsyncStatus rv = push_promise_index()->Try( 287 QuicAsyncStatus rv = push_promise_index()->Try(
288 SpdyBalsaUtils::RequestHeadersToSpdyHeaders(headers), this, &handle); 288 SpdyBalsaUtils::RequestHeadersToSpdyHeaders(headers), this, &handle);
289 if (rv == QUIC_SUCCESS) 289 if (rv == QUIC_SUCCESS)
290 return; 290 return;
291 291
292 if (rv == QUIC_PENDING) { 292 if (rv == QUIC_PENDING) {
293 // May need to retry request if asynchronous rendezvous fails. 293 // May need to retry request if asynchronous rendezvous fails.
294 auto new_headers = new BalsaHeaders; 294 auto* new_headers = new BalsaHeaders;
295 new_headers->CopyFrom(headers); 295 new_headers->CopyFrom(headers);
296 push_promise_data_to_resend_.reset( 296 push_promise_data_to_resend_.reset(
297 new ClientQuicDataToResend(new_headers, body, fin, this)); 297 new ClientQuicDataToResend(new_headers, body, fin, this));
298 return; 298 return;
299 } 299 }
300 300
301 QuicSpdyClientStream* stream = CreateReliableClientStream(); 301 QuicSpdyClientStream* stream = CreateReliableClientStream();
302 if (stream == nullptr) { 302 if (stream == nullptr) {
303 QUIC_BUG << "stream creation failed!"; 303 QUIC_BUG << "stream creation failed!";
304 return; 304 return;
305 } 305 }
306 stream->SendRequest(SpdyBalsaUtils::RequestHeadersToSpdyHeaders(headers), 306 stream->SendRequest(SpdyBalsaUtils::RequestHeadersToSpdyHeaders(headers),
307 body, fin); 307 body, fin);
308 if (FLAGS_enable_quic_stateless_reject_support) { 308 if (FLAGS_enable_quic_stateless_reject_support) {
309 // Record this in case we need to resend. 309 // Record this in case we need to resend.
310 auto new_headers = new BalsaHeaders; 310 auto* new_headers = new BalsaHeaders;
311 new_headers->CopyFrom(headers); 311 new_headers->CopyFrom(headers);
312 auto data_to_resend = 312 auto* data_to_resend =
313 new ClientQuicDataToResend(new_headers, body, fin, this); 313 new ClientQuicDataToResend(new_headers, body, fin, this);
314 MaybeAddQuicDataToResend(data_to_resend); 314 MaybeAddQuicDataToResend(data_to_resend);
315 } 315 }
316 } 316 }
317 317
318 void QuicClient::MaybeAddQuicDataToResend(QuicDataToResend* data_to_resend) { 318 void QuicClient::MaybeAddQuicDataToResend(QuicDataToResend* data_to_resend) {
319 DCHECK(FLAGS_enable_quic_stateless_reject_support); 319 DCHECK(FLAGS_enable_quic_stateless_reject_support);
320 if (session()->IsCryptoHandshakeConfirmed()) { 320 if (session()->IsCryptoHandshakeConfirmed()) {
321 // The handshake is confirmed. No need to continue saving requests to 321 // The handshake is confirmed. No need to continue saving requests to
322 // resend. 322 // resend.
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 return fd_address_map_.back().first; 498 return fd_address_map_.back().first;
499 } 499 }
500 500
501 void QuicClient::ProcessPacket(const IPEndPoint& self_address, 501 void QuicClient::ProcessPacket(const IPEndPoint& self_address,
502 const IPEndPoint& peer_address, 502 const IPEndPoint& peer_address,
503 const QuicReceivedPacket& packet) { 503 const QuicReceivedPacket& packet) {
504 session()->connection()->ProcessUdpPacket(self_address, peer_address, packet); 504 session()->connection()->ProcessUdpPacket(self_address, peer_address, packet);
505 } 505 }
506 506
507 } // namespace net 507 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_simple_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698