Commit 1dd2d4f8 authored by Ryan Hamilton's avatar Ryan Hamilton Committed by Commit Bot

Various cleanups to quic/core code to remove differences with internal versions.

Change-Id: I06b9dadc7ce41ff9a0a85a6646d5aa392fae2f9d
Reviewed-on: https://chromium-review.googlesource.com/1117559Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570991}
parent 6446758d
......@@ -6,7 +6,6 @@
#include <limits>
#include <map>
#include <string>
#include "net/third_party/quic/platform/api/quic_string.h"
#include "net/third_party/quic/platform/api/quic_test.h"
......
......@@ -5,7 +5,7 @@
#ifndef NET_THIRD_PARTY_QUIC_CORE_QUIC_CLIENT_PROMISED_INFO_H_
#define NET_THIRD_PARTY_QUIC_CORE_QUIC_CLIENT_PROMISED_INFO_H_
#include <sys/types.h>
#include <cstddef>
#include "net/third_party/quic/core/quic_alarm.h"
#include "net/third_party/quic/core/quic_client_push_promise_index.h"
......
......@@ -5,8 +5,6 @@
#ifndef NET_THIRD_PARTY_QUIC_CORE_QUIC_CLIENT_PUSH_PROMISE_INDEX_H_
#define NET_THIRD_PARTY_QUIC_CORE_QUIC_CLIENT_PUSH_PROMISE_INDEX_H_
#include <string>
#include "net/third_party/quic/core/quic_spdy_client_session_base.h"
#include "net/third_party/quic/core/quic_types.h"
#include "net/third_party/quic/platform/api/quic_export.h"
......
......@@ -474,7 +474,7 @@ class QUIC_EXPORT_PRIVATE QuicConfig {
// An alternate server address the client could connect to.
QuicFixedSocketAddress alternate_server_address_;
// Whether support HTTP/2 spdy::SETTINGS_MAX_HEADER_LIST_SIZE SETTINGS frame.
// Whether support HTTP/2 SETTINGS_MAX_HEADER_LIST_SIZE SETTINGS frame.
QuicFixedUint32 support_max_header_list_size_;
// Stateless reset token used in IETF public reset packet.
......
......@@ -5,9 +5,7 @@
#ifndef NET_THIRD_PARTY_QUIC_CORE_QUIC_CONNECTION_STATS_H_
#define NET_THIRD_PARTY_QUIC_CORE_QUIC_CONNECTION_STATS_H_
#include <stddef.h>
#include <stdint.h>
#include <cstdint>
#include <ostream>
#include "net/third_party/quic/core/quic_bandwidth.h"
......
......@@ -8,10 +8,8 @@
namespace quic {
#define ENDPOINT \
(session()->perspective() == Perspective::IS_SERVER ? "Server: " \
: "Client:" \
" ")
#define ENDPOINT \
(session()->perspective() == Perspective::IS_SERVER ? "Server: " : "Client: ")
QuicCryptoHandshaker::QuicCryptoHandshaker(QuicCryptoStream* stream,
QuicSession* session)
......
......@@ -79,7 +79,6 @@ class QUIC_EXPORT_PRIVATE QuicDataReader {
// indicating reading in little/big endian.
bool ReadConnectionId(uint64_t* connection_id);
// Returns the remaining payload as a QuicStringPiece.
// Reads tag represented as 32-bit unsigned integer into given output
// parameter. Tags are in big endian on the wire (e.g., CHLO is
// 'C','H','L','O') and are read in byte order, so tags in memory are in big
......
......@@ -5,7 +5,7 @@
#ifndef NET_THIRD_PARTY_QUIC_CORE_QUIC_DEFAULT_PACKET_WRITER_H_
#define NET_THIRD_PARTY_QUIC_CORE_QUIC_DEFAULT_PACKET_WRITER_H_
#include <stddef.h>
#include <cstddef>
#include "base/macros.h"
#include "net/third_party/quic/core/quic_packet_writer.h"
......
......@@ -22,7 +22,6 @@
#include "net/third_party/quic/platform/api/quic_stack_trace.h"
#include "net/third_party/quic/platform/api/quic_string.h"
#include "net/third_party/quic/platform/api/quic_string_piece.h"
#include "net/third_party/quic/tools/quic_simple_server_session.h"
namespace quic {
......@@ -123,7 +122,7 @@ class StatelessConnectionTerminator {
// Generates a packet containing a CONNECTION_CLOSE frame specifying
// |error_code| and |error_details| and add the connection to time wait.
void CloseConnection(QuicErrorCode error_code,
const std::string& error_details) {
const QuicString& error_details) {
QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame;
frame->error_code = error_code;
frame->error_details = error_details;
......@@ -933,7 +932,6 @@ void QuicDispatcher::ProcessChlo() {
std::make_pair(current_connection_id_, QuicWrapUnique(session)));
std::list<BufferedPacket> packets =
buffered_packets_.DeliverPackets(current_connection_id_).buffered_packets;
// Process CHLO at first.
session->ProcessUdpPacket(current_self_address_, current_peer_address_,
*current_packet_);
......
......@@ -19,16 +19,15 @@
#include "net/third_party/quic/core/quic_connection.h"
#include "net/third_party/quic/core/quic_crypto_server_stream.h"
#include "net/third_party/quic/core/quic_packets.h"
#include "net/third_party/quic/core/quic_process_packet_interface.h"
#include "net/third_party/quic/core/quic_session.h"
#include "net/third_party/quic/core/quic_time_wait_list_manager.h"
#include "net/third_party/quic/core/quic_version_manager.h"
#include "net/third_party/quic/core/stateless_rejector.h"
#include "net/third_party/quic/platform/api/quic_containers.h"
#include "net/third_party/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quic/platform/api/quic_string.h"
#include "net/third_party/quic/core/quic_process_packet_interface.h"
#include "net/third_party/quic/core/quic_time_wait_list_manager.h"
#include "net/third_party/quic/core/stateless_rejector.h"
namespace quic {
namespace test {
class QuicDispatcherPeer;
......
......@@ -6,15 +6,17 @@
#include <errno.h>
#ifndef __APPLE__
// This is a GNU header that is not present in /usr/include on MacOS
// This is a GNU header that is not present on Apple platforms
#include <features.h>
#endif
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include "net/third_party/quic/core/quic_dispatcher.h"
#include "net/third_party/quic/core/quic_packets.h"
#include "net/third_party/quic/core/quic_process_packet_interface.h"
#include "net/third_party/quic/platform/api/quic_arraysize.h"
#include "net/third_party/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quic/platform/api/quic_flags.h"
#include "net/third_party/quic/platform/api/quic_logging.h"
#include "net/third_party/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quic/platform/impl/quic_socket_utils.h"
......@@ -100,7 +102,7 @@ bool QuicPacketReader::ReadAndDispatchManyPackets(
continue;
}
if (mmsg_hdr_[i].msg_hdr.msg_flags & MSG_CTRUNC) {
if (QUIC_PREDICT_FALSE(mmsg_hdr_[i].msg_hdr.msg_flags & MSG_CTRUNC)) {
QUIC_BUG << "Incorrectly set control length: "
<< mmsg_hdr_[i].msg_hdr.msg_controllen << ", expected "
<< kCmsgSpaceForReadPacket;
......@@ -163,7 +165,7 @@ bool QuicPacketReader::ReadAndDispatchSinglePacket(
QuicIpAddress server_ip;
QuicWallTime walltimestamp = QuicWallTime::Zero();
int bytes_read =
QuicSocketUtils::ReadPacket(fd, buf, arraysize(buf), packets_dropped,
QuicSocketUtils::ReadPacket(fd, buf, QUIC_ARRAYSIZE(buf), packets_dropped,
&server_ip, &walltimestamp, &client_address);
if (bytes_read < 0) {
return false; // ReadPacket failed.
......
......@@ -65,14 +65,12 @@ class QuicPacketReader {
ProcessPacketInterface* processor,
QuicPacketCount* packets_dropped);
// Storage only used when recvmmsg is available.
#if MMSG_MORE
// Storage only used when recvmmsg is available.
// TODO(danzh): change it to be a pointer to avoid the allocation on the stack
// from exceeding maximum allowed frame size.
// packets_ and mmsg_hdr_ are used to supply cbuf and buf to the recvmmsg
// call.
struct PacketData {
iovec iov;
// raw_address is used for address information provided by the recvmmsg
......
......@@ -5,8 +5,7 @@
#ifndef NET_THIRD_PARTY_QUIC_CORE_QUIC_PACKET_WRITER_WRAPPER_H_
#define NET_THIRD_PARTY_QUIC_CORE_QUIC_PACKET_WRITER_WRAPPER_H_
#include <stddef.h>
#include <cstddef>
#include <memory>
#include "base/macros.h"
......
......@@ -5,7 +5,7 @@
#ifndef NET_THIRD_PARTY_QUIC_CORE_QUIC_PER_CONNECTION_PACKET_WRITER_H_
#define NET_THIRD_PARTY_QUIC_CORE_QUIC_PER_CONNECTION_PACKET_WRITER_H_
#include <stddef.h>
#include <cstddef>
#include "base/macros.h"
#include "net/third_party/quic/core/quic_connection.h"
......
......@@ -7,7 +7,6 @@
#include <algorithm>
#include <sstream>
#include "net/quic/chromium/quic_utils_chromium.h"
#include "net/third_party/quic/core/congestion_control/general_loss_algorithm.h"
#include "net/third_party/quic/core/congestion_control/pacing_sender.h"
#include "net/third_party/quic/core/crypto/crypto_protocol.h"
......
......@@ -5,8 +5,7 @@
#ifndef NET_THIRD_PARTY_QUIC_CORE_QUIC_SENT_PACKET_MANAGER_H_
#define NET_THIRD_PARTY_QUIC_CORE_QUIC_SENT_PACKET_MANAGER_H_
#include <stddef.h>
#include <cstddef>
#include <map>
#include <memory>
#include <set>
......@@ -19,6 +18,7 @@
#include "net/third_party/quic/core/congestion_control/pacing_sender.h"
#include "net/third_party/quic/core/congestion_control/rtt_stats.h"
#include "net/third_party/quic/core/congestion_control/send_algorithm_interface.h"
#include "net/third_party/quic/core/proto/cached_network_parameters.pb.h"
#include "net/third_party/quic/core/quic_debug_info_provider_interface.h"
#include "net/third_party/quic/core/quic_packets.h"
#include "net/third_party/quic/core/quic_pending_retransmission.h"
......
......@@ -6,7 +6,6 @@
#include <memory>
#include "base/callback.h"
#include "net/third_party/quic/core/quic_pending_retransmission.h"
#include "net/third_party/quic/platform/api/quic_arraysize.h"
#include "net/third_party/quic/platform/api/quic_flags.h"
......@@ -16,9 +15,7 @@
#include "net/third_party/quic/test_tools/quic_config_peer.h"
#include "net/third_party/quic/test_tools/quic_sent_packet_manager_peer.h"
#include "net/third_party/quic/test_tools/quic_test_utils.h"
#include "testing/gmock_mutant.h"
using base::Unretained;
using testing::_;
using testing::AnyNumber;
using testing::Invoke;
......
......@@ -4,12 +4,12 @@
#include "net/third_party/quic/core/tls_handshaker.h"
#include "base/no_destructor.h"
#include "net/third_party/quic/core/quic_crypto_stream.h"
#include "net/third_party/quic/core/tls_client_handshaker.h"
#include "net/third_party/quic/platform/api/quic_arraysize.h"
#include "net/third_party/quic/platform/api/quic_singleton.h"
#include "third_party/boringssl/src/include/openssl/crypto.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
namespace quic {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment