| OLD | NEW |
| 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_simple_client.h" | 5 #include "net/tools/quic/quic_simple_client.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 11 #include "net/http/http_request_info.h" | 13 #include "net/http/http_request_info.h" |
| 12 #include "net/http/http_response_info.h" | 14 #include "net/http/http_response_info.h" |
| 13 #include "net/quic/crypto/quic_random.h" | 15 #include "net/quic/crypto/quic_random.h" |
| 14 #include "net/quic/quic_chromium_alarm_factory.h" | 16 #include "net/quic/quic_chromium_alarm_factory.h" |
| 15 #include "net/quic/quic_chromium_connection_helper.h" | 17 #include "net/quic/quic_chromium_connection_helper.h" |
| 16 #include "net/quic/quic_chromium_packet_reader.h" | 18 #include "net/quic/quic_chromium_packet_reader.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 bool fin) { | 251 bool fin) { |
| 250 QuicSpdyClientStream* stream = CreateReliableClientStream(); | 252 QuicSpdyClientStream* stream = CreateReliableClientStream(); |
| 251 if (stream == nullptr) { | 253 if (stream == nullptr) { |
| 252 LOG(DFATAL) << "stream creation failed!"; | 254 LOG(DFATAL) << "stream creation failed!"; |
| 253 return; | 255 return; |
| 254 } | 256 } |
| 255 SpdyHeaderBlock header_block; | 257 SpdyHeaderBlock header_block; |
| 256 CreateSpdyHeadersFromHttpRequest(headers, headers.extra_headers, net::HTTP2, | 258 CreateSpdyHeadersFromHttpRequest(headers, headers.extra_headers, net::HTTP2, |
| 257 true, &header_block); | 259 true, &header_block); |
| 258 stream->set_visitor(this); | 260 stream->set_visitor(this); |
| 259 stream->SendRequest(header_block, body, fin); | 261 stream->SendRequest(std::move(header_block), body, fin); |
| 260 if (FLAGS_enable_quic_stateless_reject_support) { | 262 if (FLAGS_enable_quic_stateless_reject_support) { |
| 261 // Record this in case we need to resend. | 263 // Record this in case we need to resend. |
| 262 auto new_headers = new HttpRequestInfo; | 264 auto new_headers = new HttpRequestInfo; |
| 263 *new_headers = headers; | 265 *new_headers = headers; |
| 264 auto data_to_resend = | 266 auto data_to_resend = |
| 265 new ClientQuicDataToResend(new_headers, body, fin, this); | 267 new ClientQuicDataToResend(new_headers, body, fin, this); |
| 266 MaybeAddQuicDataToResend(data_to_resend); | 268 MaybeAddQuicDataToResend(data_to_resend); |
| 267 } | 269 } |
| 268 } | 270 } |
| 269 | 271 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 session()->connection()->ProcessUdpPacket(local_address, peer_address, | 407 session()->connection()->ProcessUdpPacket(local_address, peer_address, |
| 406 packet); | 408 packet); |
| 407 if (!session()->connection()->connected()) { | 409 if (!session()->connection()->connected()) { |
| 408 return false; | 410 return false; |
| 409 } | 411 } |
| 410 | 412 |
| 411 return true; | 413 return true; |
| 412 } | 414 } |
| 413 | 415 |
| 414 } // namespace net | 416 } // namespace net |
| OLD | NEW |