clang-format QUICHE
Run clang-format on *.h and *.cc file in QUICHE.
Tested:
TAP train for global presubmit queue
http://test/OCL:441019867:BASE:441135378:1649787842054:8cba41ad
PiperOrigin-RevId: 441488431
diff --git a/quiche/quic/tools/fake_proof_verifier.h b/quiche/quic/tools/fake_proof_verifier.h
index 62ab87a..9350fc6 100644
--- a/quiche/quic/tools/fake_proof_verifier.h
+++ b/quiche/quic/tools/fake_proof_verifier.h
@@ -15,30 +15,22 @@
public:
~FakeProofVerifier() override {}
QuicAsyncStatus VerifyProof(
- const std::string& /*hostname*/,
- const uint16_t /*port*/,
+ const std::string& /*hostname*/, const uint16_t /*port*/,
const std::string& /*server_config*/,
- QuicTransportVersion /*quic_version*/,
- absl::string_view /*chlo_hash*/,
+ QuicTransportVersion /*quic_version*/, absl::string_view /*chlo_hash*/,
const std::vector<std::string>& /*certs*/,
- const std::string& /*cert_sct*/,
- const std::string& /*signature*/,
- const ProofVerifyContext* /*context*/,
- std::string* /*error_details*/,
+ const std::string& /*cert_sct*/, const std::string& /*signature*/,
+ const ProofVerifyContext* /*context*/, std::string* /*error_details*/,
std::unique_ptr<ProofVerifyDetails>* /*details*/,
std::unique_ptr<ProofVerifierCallback> /*callback*/) override {
return QUIC_SUCCESS;
}
QuicAsyncStatus VerifyCertChain(
- const std::string& /*hostname*/,
- const uint16_t /*port*/,
+ const std::string& /*hostname*/, const uint16_t /*port*/,
const std::vector<std::string>& /*certs*/,
- const std::string& /*ocsp_response*/,
- const std::string& /*cert_sct*/,
- const ProofVerifyContext* /*context*/,
- std::string* /*error_details*/,
- std::unique_ptr<ProofVerifyDetails>* /*details*/,
- uint8_t* /*out_alert*/,
+ const std::string& /*ocsp_response*/, const std::string& /*cert_sct*/,
+ const ProofVerifyContext* /*context*/, std::string* /*error_details*/,
+ std::unique_ptr<ProofVerifyDetails>* /*details*/, uint8_t* /*out_alert*/,
std::unique_ptr<ProofVerifierCallback> /*callback*/) override {
return QUIC_SUCCESS;
}
diff --git a/quiche/quic/tools/quic_backend_response.cc b/quiche/quic/tools/quic_backend_response.cc
index d079d63..8fce5d5 100644
--- a/quiche/quic/tools/quic_backend_response.cc
+++ b/quiche/quic/tools/quic_backend_response.cc
@@ -7,10 +7,8 @@
namespace quic {
QuicBackendResponse::ServerPushInfo::ServerPushInfo(
- QuicUrl request_url,
- spdy::Http2HeaderBlock headers,
- spdy::SpdyPriority priority,
- std::string body)
+ QuicUrl request_url, spdy::Http2HeaderBlock headers,
+ spdy::SpdyPriority priority, std::string body)
: request_url(request_url),
headers(std::move(headers)),
priority(priority),
diff --git a/quiche/quic/tools/quic_backend_response.h b/quiche/quic/tools/quic_backend_response.h
index e67e186..3ee4bf4 100644
--- a/quiche/quic/tools/quic_backend_response.h
+++ b/quiche/quic/tools/quic_backend_response.h
@@ -19,10 +19,8 @@
// comprising a response for the push request.
// TODO(b/171463363): Remove.
struct ServerPushInfo {
- ServerPushInfo(QuicUrl request_url,
- spdy::Http2HeaderBlock headers,
- spdy::SpdyPriority priority,
- std::string body);
+ ServerPushInfo(QuicUrl request_url, spdy::Http2HeaderBlock headers,
+ spdy::SpdyPriority priority, std::string body);
ServerPushInfo(const ServerPushInfo& other);
QuicUrl request_url;
diff --git a/quiche/quic/tools/quic_client.cc b/quiche/quic/tools/quic_client.cc
index a493e9c..b024ac6 100644
--- a/quiche/quic/tools/quic_client.cc
+++ b/quiche/quic/tools/quic_client.cc
@@ -31,8 +31,7 @@
namespace tools {
-QuicSocketAddress LookupAddress(int address_family_for_lookup,
- std::string host,
+QuicSocketAddress LookupAddress(int address_family_for_lookup, std::string host,
std::string port) {
addrinfo hint;
memset(&hint, 0, sizeof(hint));
@@ -61,14 +60,10 @@
QuicEpollServer* epoll_server,
std::unique_ptr<ProofVerifier> proof_verifier)
: QuicClient(
- server_address,
- server_id,
- supported_versions,
- QuicConfig(),
+ server_address, server_id, supported_versions, QuicConfig(),
epoll_server,
std::make_unique<QuicClientEpollNetworkHelper>(epoll_server, this),
- std::move(proof_verifier),
- nullptr) {}
+ std::move(proof_verifier), nullptr) {}
QuicClient::QuicClient(QuicSocketAddress server_address,
const QuicServerId& server_id,
@@ -77,83 +72,54 @@
std::unique_ptr<ProofVerifier> proof_verifier,
std::unique_ptr<SessionCache> session_cache)
: QuicClient(
- server_address,
- server_id,
- supported_versions,
- QuicConfig(),
+ server_address, server_id, supported_versions, QuicConfig(),
epoll_server,
std::make_unique<QuicClientEpollNetworkHelper>(epoll_server, this),
- std::move(proof_verifier),
- std::move(session_cache)) {}
+ std::move(proof_verifier), std::move(session_cache)) {}
QuicClient::QuicClient(QuicSocketAddress server_address,
const QuicServerId& server_id,
const ParsedQuicVersionVector& supported_versions,
- const QuicConfig& config,
- QuicEpollServer* epoll_server,
+ const QuicConfig& config, QuicEpollServer* epoll_server,
std::unique_ptr<ProofVerifier> proof_verifier,
std::unique_ptr<SessionCache> session_cache)
: QuicClient(
- server_address,
- server_id,
- supported_versions,
- config,
- epoll_server,
+ server_address, server_id, supported_versions, config, epoll_server,
std::make_unique<QuicClientEpollNetworkHelper>(epoll_server, this),
- std::move(proof_verifier),
- std::move(session_cache)) {}
+ std::move(proof_verifier), std::move(session_cache)) {}
QuicClient::QuicClient(
- QuicSocketAddress server_address,
- const QuicServerId& server_id,
+ QuicSocketAddress server_address, const QuicServerId& server_id,
const ParsedQuicVersionVector& supported_versions,
QuicEpollServer* epoll_server,
std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
std::unique_ptr<ProofVerifier> proof_verifier)
- : QuicClient(server_address,
- server_id,
- supported_versions,
- QuicConfig(),
- epoll_server,
- std::move(network_helper),
- std::move(proof_verifier),
- nullptr) {}
+ : QuicClient(server_address, server_id, supported_versions, QuicConfig(),
+ epoll_server, std::move(network_helper),
+ std::move(proof_verifier), nullptr) {}
QuicClient::QuicClient(
- QuicSocketAddress server_address,
- const QuicServerId& server_id,
- const ParsedQuicVersionVector& supported_versions,
- const QuicConfig& config,
+ QuicSocketAddress server_address, const QuicServerId& server_id,
+ const ParsedQuicVersionVector& supported_versions, const QuicConfig& config,
QuicEpollServer* epoll_server,
std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
std::unique_ptr<ProofVerifier> proof_verifier)
- : QuicClient(server_address,
- server_id,
- supported_versions,
- config,
- epoll_server,
- std::move(network_helper),
- std::move(proof_verifier),
- nullptr) {}
+ : QuicClient(server_address, server_id, supported_versions, config,
+ epoll_server, std::move(network_helper),
+ std::move(proof_verifier), nullptr) {}
QuicClient::QuicClient(
- QuicSocketAddress server_address,
- const QuicServerId& server_id,
- const ParsedQuicVersionVector& supported_versions,
- const QuicConfig& config,
+ QuicSocketAddress server_address, const QuicServerId& server_id,
+ const ParsedQuicVersionVector& supported_versions, const QuicConfig& config,
QuicEpollServer* epoll_server,
std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
std::unique_ptr<ProofVerifier> proof_verifier,
std::unique_ptr<SessionCache> session_cache)
: QuicSpdyClientBase(
- server_id,
- supported_versions,
- config,
+ server_id, supported_versions, config,
new QuicEpollConnectionHelper(epoll_server, QuicAllocator::SIMPLE),
- new QuicEpollAlarmFactory(epoll_server),
- std::move(network_helper),
- std::move(proof_verifier),
- std::move(session_cache)) {
+ new QuicEpollAlarmFactory(epoll_server), std::move(network_helper),
+ std::move(proof_verifier), std::move(session_cache)) {
set_server_address(server_address);
}
diff --git a/quiche/quic/tools/quic_client.h b/quiche/quic/tools/quic_client.h
index 446e9c6..ebf8cb9 100644
--- a/quiche/quic/tools/quic_client.h
+++ b/quiche/quic/tools/quic_client.h
@@ -31,8 +31,7 @@
namespace tools {
-QuicSocketAddress LookupAddress(int address_family_for_lookup,
- std::string host,
+QuicSocketAddress LookupAddress(int address_family_for_lookup, std::string host,
std::string port);
inline QuicSocketAddress LookupAddress(std::string host, std::string port) {
@@ -44,43 +43,34 @@
class QuicClient : public QuicSpdyClientBase {
public:
// These will create their own QuicClientEpollNetworkHelper.
- QuicClient(QuicSocketAddress server_address,
- const QuicServerId& server_id,
+ QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
const ParsedQuicVersionVector& supported_versions,
QuicEpollServer* epoll_server,
std::unique_ptr<ProofVerifier> proof_verifier);
- QuicClient(QuicSocketAddress server_address,
- const QuicServerId& server_id,
+ QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
const ParsedQuicVersionVector& supported_versions,
QuicEpollServer* epoll_server,
std::unique_ptr<ProofVerifier> proof_verifier,
std::unique_ptr<SessionCache> session_cache);
- QuicClient(QuicSocketAddress server_address,
- const QuicServerId& server_id,
+ QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
const ParsedQuicVersionVector& supported_versions,
- const QuicConfig& config,
- QuicEpollServer* epoll_server,
+ const QuicConfig& config, QuicEpollServer* epoll_server,
std::unique_ptr<ProofVerifier> proof_verifier,
std::unique_ptr<SessionCache> session_cache);
// This will take ownership of a passed in network primitive.
- QuicClient(QuicSocketAddress server_address,
- const QuicServerId& server_id,
+ QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
const ParsedQuicVersionVector& supported_versions,
QuicEpollServer* epoll_server,
std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
std::unique_ptr<ProofVerifier> proof_verifier);
- QuicClient(QuicSocketAddress server_address,
- const QuicServerId& server_id,
+ QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
const ParsedQuicVersionVector& supported_versions,
- const QuicConfig& config,
- QuicEpollServer* epoll_server,
+ const QuicConfig& config, QuicEpollServer* epoll_server,
std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
std::unique_ptr<ProofVerifier> proof_verifier);
- QuicClient(QuicSocketAddress server_address,
- const QuicServerId& server_id,
+ QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
const ParsedQuicVersionVector& supported_versions,
- const QuicConfig& config,
- QuicEpollServer* epoll_server,
+ const QuicConfig& config, QuicEpollServer* epoll_server,
std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
std::unique_ptr<ProofVerifier> proof_verifier,
std::unique_ptr<SessionCache> session_cache);
diff --git a/quiche/quic/tools/quic_client_base.cc b/quiche/quic/tools/quic_client_base.cc
index 63c604d..826ade8 100644
--- a/quiche/quic/tools/quic_client_base.cc
+++ b/quiche/quic/tools/quic_client_base.cc
@@ -77,10 +77,8 @@
QuicClientBase::QuicClientBase(
const QuicServerId& server_id,
- const ParsedQuicVersionVector& supported_versions,
- const QuicConfig& config,
- QuicConnectionHelperInterface* helper,
- QuicAlarmFactory* alarm_factory,
+ const ParsedQuicVersionVector& supported_versions, const QuicConfig& config,
+ QuicConnectionHelperInterface* helper, QuicAlarmFactory* alarm_factory,
std::unique_ptr<NetworkHelper> network_helper,
std::unique_ptr<ProofVerifier> proof_verifier,
std::unique_ptr<SessionCache> session_cache)
@@ -206,9 +204,7 @@
set_connected_or_attempting_connect(true);
}
-void QuicClientBase::InitializeSession() {
- session()->Initialize();
-}
+void QuicClientBase::InitializeSession() { session()->Initialize(); }
void QuicClientBase::Disconnect() {
QUICHE_DCHECK(initialized_);
@@ -260,8 +256,7 @@
}
bool QuicClientBase::MigrateSocketWithSpecifiedPort(
- const QuicIpAddress& new_host,
- int port) {
+ const QuicIpAddress& new_host, int port) {
if (!connected()) {
QUICHE_DVLOG(1)
<< "MigrateSocketWithSpecifiedPort failed as connection has closed";
@@ -310,8 +305,7 @@
}
std::unique_ptr<QuicPacketWriter> QuicClientBase::CreateWriterForNewNetwork(
- const QuicIpAddress& new_host,
- int port) {
+ const QuicIpAddress& new_host, int port) {
set_bind_to_address(new_host);
set_local_port(port);
if (!network_helper_->CreateUDPSocketAndBind(server_address_,
@@ -331,13 +325,9 @@
return MigrateSocketWithSpecifiedPort(current_host, 0 /*any ephemeral port*/);
}
-QuicSession* QuicClientBase::session() {
- return session_.get();
-}
+QuicSession* QuicClientBase::session() { return session_.get(); }
-const QuicSession* QuicClientBase::session() const {
- return session_.get();
-}
+const QuicSession* QuicClientBase::session() const { return session_.get(); }
QuicClientBase::NetworkHelper* QuicClientBase::network_helper() {
return network_helper_.get();
diff --git a/quiche/quic/tools/quic_client_base.h b/quiche/quic/tools/quic_client_base.h
index 9b568eb..4f0c880 100644
--- a/quiche/quic/tools/quic_client_base.h
+++ b/quiche/quic/tools/quic_client_base.h
@@ -324,8 +324,7 @@
bool CanReconnectWithDifferentVersion(ParsedQuicVersion* version) const;
std::unique_ptr<QuicPacketWriter> CreateWriterForNewNetwork(
- const QuicIpAddress& new_host,
- int port);
+ const QuicIpAddress& new_host, int port);
// |server_id_| is a tuple (hostname, port, is_https) of the server.
QuicServerId server_id_;
diff --git a/quiche/quic/tools/quic_client_epoll_network_helper.cc b/quiche/quic/tools/quic_client_epoll_network_helper.cc
index f42c4ed..14b905d 100644
--- a/quiche/quic/tools/quic_client_epoll_network_helper.cc
+++ b/quiche/quic/tools/quic_client_epoll_network_helper.cc
@@ -31,8 +31,7 @@
} // namespace
QuicClientEpollNetworkHelper::QuicClientEpollNetworkHelper(
- QuicEpollServer* epoll_server,
- QuicClientBase* client)
+ QuicEpollServer* epoll_server, QuicClientBase* client)
: epoll_server_(epoll_server),
packets_dropped_(0),
overflow_supported_(false),
@@ -55,8 +54,7 @@
}
bool QuicClientEpollNetworkHelper::CreateUDPSocketAndBind(
- QuicSocketAddress server_address,
- QuicIpAddress bind_to_address,
+ QuicSocketAddress server_address, QuicIpAddress bind_to_address,
int bind_to_port) {
epoll_server_->set_timeout_in_us(50 * 1000);
@@ -204,14 +202,12 @@
void QuicClientEpollNetworkHelper::ProcessPacket(
const QuicSocketAddress& self_address,
- const QuicSocketAddress& peer_address,
- const QuicReceivedPacket& packet) {
+ const QuicSocketAddress& peer_address, const QuicReceivedPacket& packet) {
client_->session()->ProcessUdpPacket(self_address, peer_address, packet);
}
int QuicClientEpollNetworkHelper::CreateUDPSocket(
- QuicSocketAddress server_address,
- bool* overflow_supported) {
+ QuicSocketAddress server_address, bool* overflow_supported) {
QuicUdpSocketApi api;
int fd = api.Create(server_address.host().AddressFamilyToInt(),
/*receive_buffer_size =*/kDefaultSocketReceiveBuffer,
diff --git a/quiche/quic/tools/quic_client_interop_test_bin.cc b/quiche/quic/tools/quic_client_interop_test_bin.cc
index ece457f..549be2e 100644
--- a/quiche/quic/tools/quic_client_interop_test_bin.cc
+++ b/quiche/quic/tools/quic_client_interop_test_bin.cc
@@ -108,14 +108,10 @@
// Feature::kResumption to it, otherwise it is left unmodified.
void AttemptResumption(QuicClient* client, const std::string& authority);
- void AttemptRequest(QuicSocketAddress addr,
- std::string authority,
- QuicServerId server_id,
- ParsedQuicVersion version,
- bool test_version_negotiation,
- bool attempt_rebind,
- bool attempt_multi_packet_chlo,
- bool attempt_key_update);
+ void AttemptRequest(QuicSocketAddress addr, std::string authority,
+ QuicServerId server_id, ParsedQuicVersion version,
+ bool test_version_negotiation, bool attempt_rebind,
+ bool attempt_multi_packet_chlo, bool attempt_key_update);
// Constructs a SpdyHeaderBlock containing the pseudo-headers needed to make a
// GET request to "/" on the hostname |authority|.
@@ -193,14 +189,11 @@
}
}
-void QuicClientInteropRunner::AttemptRequest(QuicSocketAddress addr,
- std::string authority,
- QuicServerId server_id,
- ParsedQuicVersion version,
- bool test_version_negotiation,
- bool attempt_rebind,
- bool attempt_multi_packet_chlo,
- bool attempt_key_update) {
+void QuicClientInteropRunner::AttemptRequest(
+ QuicSocketAddress addr, std::string authority, QuicServerId server_id,
+ ParsedQuicVersion version, bool test_version_negotiation,
+ bool attempt_rebind, bool attempt_multi_packet_chlo,
+ bool attempt_key_update) {
ParsedQuicVersionVector versions = {version};
if (test_version_negotiation) {
versions.insert(versions.begin(), QuicVersionReservedForNegotiation());
@@ -345,8 +338,7 @@
}
void QuicClientInteropRunner::SendRequest(
- QuicClient* client,
- const spdy::Http2HeaderBlock& header_block) {
+ QuicClient* client, const spdy::Http2HeaderBlock& header_block) {
client->set_store_response(true);
client->SendRequestAndWaitForResponse(header_block, "", /*fin=*/true);
@@ -367,10 +359,8 @@
}
}
-std::set<Feature> ServerSupport(std::string dns_host,
- std::string url_host,
- int port,
- ParsedQuicVersion version) {
+std::set<Feature> ServerSupport(std::string dns_host, std::string url_host,
+ int port, ParsedQuicVersion version) {
std::cout << "Attempting interop with version " << version << std::endl;
// Build the client, and try to connect.
diff --git a/quiche/quic/tools/quic_epoll_client_factory.cc b/quiche/quic/tools/quic_epoll_client_factory.cc
index 2719057..590a408 100644
--- a/quiche/quic/tools/quic_epoll_client_factory.cc
+++ b/quiche/quic/tools/quic_epoll_client_factory.cc
@@ -18,12 +18,9 @@
namespace quic {
std::unique_ptr<QuicSpdyClientBase> QuicEpollClientFactory::CreateClient(
- std::string host_for_handshake,
- std::string host_for_lookup,
- int address_family_for_lookup,
- uint16_t port,
- ParsedQuicVersionVector versions,
- const QuicConfig& config,
+ std::string host_for_handshake, std::string host_for_lookup,
+ int address_family_for_lookup, uint16_t port,
+ ParsedQuicVersionVector versions, const QuicConfig& config,
std::unique_ptr<ProofVerifier> verifier,
std::unique_ptr<SessionCache> session_cache) {
QuicSocketAddress addr = tools::LookupAddress(
diff --git a/quiche/quic/tools/quic_epoll_client_factory.h b/quiche/quic/tools/quic_epoll_client_factory.h
index a911c50..f2dd7c5 100644
--- a/quiche/quic/tools/quic_epoll_client_factory.h
+++ b/quiche/quic/tools/quic_epoll_client_factory.h
@@ -14,12 +14,9 @@
class QuicEpollClientFactory : public QuicToyClient::ClientFactory {
public:
std::unique_ptr<QuicSpdyClientBase> CreateClient(
- std::string host_for_handshake,
- std::string host_for_lookup,
- int address_family_for_lookup,
- uint16_t port,
- ParsedQuicVersionVector versions,
- const QuicConfig& config,
+ std::string host_for_handshake, std::string host_for_lookup,
+ int address_family_for_lookup, uint16_t port,
+ ParsedQuicVersionVector versions, const QuicConfig& config,
std::unique_ptr<ProofVerifier> verifier,
std::unique_ptr<SessionCache> session_cache) override;
diff --git a/quiche/quic/tools/quic_memory_cache_backend.h b/quiche/quic/tools/quic_memory_cache_backend.h
index 986badb..e272351 100644
--- a/quiche/quic/tools/quic_memory_cache_backend.h
+++ b/quiche/quic/tools/quic_memory_cache_backend.h
@@ -81,10 +81,8 @@
// Adds a simple response to the cache. The response headers will
// only contain the "content-length" header with the length of |body|.
- void AddSimpleResponse(absl::string_view host,
- absl::string_view path,
- int response_code,
- absl::string_view body);
+ void AddSimpleResponse(absl::string_view host, absl::string_view path,
+ int response_code, absl::string_view body);
// Add a simple response to the cache as AddSimpleResponse() does, and add
// some server push resources(resource path, corresponding response status and
@@ -92,44 +90,35 @@
// Push resource implicitly come from the same host.
// TODO(b/171463363): Remove.
void AddSimpleResponseWithServerPushResources(
- absl::string_view host,
- absl::string_view path,
- int response_code,
+ absl::string_view host, absl::string_view path, int response_code,
absl::string_view body,
std::list<QuicBackendResponse::ServerPushInfo> push_resources);
// Add a response to the cache.
- void AddResponse(absl::string_view host,
- absl::string_view path,
+ void AddResponse(absl::string_view host, absl::string_view path,
spdy::Http2HeaderBlock response_headers,
absl::string_view response_body);
// Add a response, with trailers, to the cache.
- void AddResponse(absl::string_view host,
- absl::string_view path,
+ void AddResponse(absl::string_view host, absl::string_view path,
spdy::Http2HeaderBlock response_headers,
absl::string_view response_body,
spdy::Http2HeaderBlock response_trailers);
// Add a response, with 103 Early Hints, to the cache.
void AddResponseWithEarlyHints(
- absl::string_view host,
- absl::string_view path,
- spdy::Http2HeaderBlock response_headers,
- absl::string_view response_body,
+ absl::string_view host, absl::string_view path,
+ spdy::Http2HeaderBlock response_headers, absl::string_view response_body,
const std::vector<spdy::Http2HeaderBlock>& early_hints);
// Simulate a special behavior at a particular path.
void AddSpecialResponse(
- absl::string_view host,
- absl::string_view path,
+ absl::string_view host, absl::string_view path,
QuicBackendResponse::SpecialResponseType response_type);
void AddSpecialResponse(
- absl::string_view host,
- absl::string_view path,
- spdy::Http2HeaderBlock response_headers,
- absl::string_view response_body,
+ absl::string_view host, absl::string_view path,
+ spdy::Http2HeaderBlock response_headers, absl::string_view response_body,
QuicBackendResponse::SpecialResponseType response_type);
// Sets a default response in case of cache misses. Takes ownership of
@@ -163,8 +152,7 @@
bool SupportsWebTransport() override { return enable_webtransport_; }
private:
- void AddResponseImpl(absl::string_view host,
- absl::string_view path,
+ void AddResponseImpl(absl::string_view host, absl::string_view path,
QuicBackendResponse::SpecialResponseType response_type,
spdy::Http2HeaderBlock response_headers,
absl::string_view response_body,
@@ -177,8 +165,7 @@
// request if these push resources are not associated with this request yet.
// TODO(b/171463363): Remove.
void MaybeAddServerPushResources(
- absl::string_view request_host,
- absl::string_view request_path,
+ absl::string_view request_host, absl::string_view request_path,
std::list<QuicBackendResponse::ServerPushInfo> push_resources);
// Check if push resource(push_host/push_path) associated with given request
diff --git a/quiche/quic/tools/quic_server.cc b/quiche/quic/tools/quic_server.cc
index aa521ef..c5ab6ea 100644
--- a/quiche/quic/tools/quic_server.cc
+++ b/quiche/quic/tools/quic_server.cc
@@ -45,23 +45,18 @@
QuicServer::QuicServer(std::unique_ptr<ProofSource> proof_source,
QuicSimpleServerBackend* quic_simple_server_backend)
- : QuicServer(std::move(proof_source),
- quic_simple_server_backend,
+ : QuicServer(std::move(proof_source), quic_simple_server_backend,
AllSupportedVersions()) {}
QuicServer::QuicServer(std::unique_ptr<ProofSource> proof_source,
QuicSimpleServerBackend* quic_simple_server_backend,
const ParsedQuicVersionVector& supported_versions)
- : QuicServer(std::move(proof_source),
- QuicConfig(),
- QuicCryptoServerConfig::ConfigOptions(),
- supported_versions,
- quic_simple_server_backend,
- kQuicDefaultConnectionIdLength) {}
+ : QuicServer(std::move(proof_source), QuicConfig(),
+ QuicCryptoServerConfig::ConfigOptions(), supported_versions,
+ quic_simple_server_backend, kQuicDefaultConnectionIdLength) {}
QuicServer::QuicServer(
- std::unique_ptr<ProofSource> proof_source,
- const QuicConfig& config,
+ std::unique_ptr<ProofSource> proof_source, const QuicConfig& config,
const QuicCryptoServerConfig::ConfigOptions& crypto_config_options,
const ParsedQuicVersionVector& supported_versions,
QuicSimpleServerBackend* quic_simple_server_backend,
@@ -72,10 +67,8 @@
overflow_supported_(false),
silent_close_(false),
config_(config),
- crypto_config_(kSourceAddressTokenSecret,
- QuicRandom::GetInstance(),
- std::move(proof_source),
- KeyExchangeSource::Default()),
+ crypto_config_(kSourceAddressTokenSecret, QuicRandom::GetInstance(),
+ std::move(proof_source), KeyExchangeSource::Default()),
crypto_config_options_(crypto_config_options),
version_manager_(supported_versions),
packet_reader_(new QuicPacketReader()),
diff --git a/quiche/quic/tools/quic_server.h b/quiche/quic/tools/quic_server.h
index 9024289..5c65fe0 100644
--- a/quiche/quic/tools/quic_server.h
+++ b/quiche/quic/tools/quic_server.h
@@ -68,8 +68,7 @@
virtual void Shutdown();
// From EpollCallbackInterface
- void OnRegistration(QuicEpollServer* /*eps*/,
- int /*fd*/,
+ void OnRegistration(QuicEpollServer* /*eps*/, int /*fd*/,
int /*event_mask*/) override {}
void OnModification(int /*fd*/, int /*event_mask*/) override {}
void OnEvent(int /*fd*/, QuicEpollEvent* /*event*/) override;
diff --git a/quiche/quic/tools/quic_server_test.cc b/quiche/quic/tools/quic_server_test.cc
index 5994689..b0094be 100644
--- a/quiche/quic/tools/quic_server_test.cc
+++ b/quiche/quic/tools/quic_server_test.cc
@@ -30,21 +30,16 @@
class MockQuicSimpleDispatcher : public QuicSimpleDispatcher {
public:
MockQuicSimpleDispatcher(
- const QuicConfig* config,
- const QuicCryptoServerConfig* crypto_config,
+ const QuicConfig* config, const QuicCryptoServerConfig* crypto_config,
QuicVersionManager* version_manager,
std::unique_ptr<QuicConnectionHelperInterface> helper,
std::unique_ptr<QuicCryptoServerStreamBase::Helper> session_helper,
std::unique_ptr<QuicAlarmFactory> alarm_factory,
QuicSimpleServerBackend* quic_simple_server_backend)
- : QuicSimpleDispatcher(config,
- crypto_config,
- version_manager,
- std::move(helper),
- std::move(session_helper),
- std::move(alarm_factory),
- quic_simple_server_backend,
- kQuicDefaultConnectionIdLength) {}
+ : QuicSimpleDispatcher(
+ config, crypto_config, version_manager, std::move(helper),
+ std::move(session_helper), std::move(alarm_factory),
+ quic_simple_server_backend, kQuicDefaultConnectionIdLength) {}
~MockQuicSimpleDispatcher() override = default;
MOCK_METHOD(void, OnCanWrite, (), (override));
@@ -148,23 +143,19 @@
class QuicServerDispatchPacketTest : public QuicTest {
public:
QuicServerDispatchPacketTest()
- : crypto_config_("blah",
- QuicRandom::GetInstance(),
+ : crypto_config_("blah", QuicRandom::GetInstance(),
crypto_test_utils::ProofSourceForTesting(),
KeyExchangeSource::Default()),
version_manager_(AllSupportedVersions()),
- dispatcher_(
- &config_,
- &crypto_config_,
- &version_manager_,
- std::unique_ptr<QuicEpollConnectionHelper>(
- new QuicEpollConnectionHelper(&eps_,
- QuicAllocator::BUFFER_POOL)),
- std::unique_ptr<QuicCryptoServerStreamBase::Helper>(
- new QuicSimpleCryptoServerStreamHelper()),
- std::unique_ptr<QuicEpollAlarmFactory>(
- new QuicEpollAlarmFactory(&eps_)),
- &quic_simple_server_backend_) {
+ dispatcher_(&config_, &crypto_config_, &version_manager_,
+ std::unique_ptr<QuicEpollConnectionHelper>(
+ new QuicEpollConnectionHelper(
+ &eps_, QuicAllocator::BUFFER_POOL)),
+ std::unique_ptr<QuicCryptoServerStreamBase::Helper>(
+ new QuicSimpleCryptoServerStreamHelper()),
+ std::unique_ptr<QuicEpollAlarmFactory>(
+ new QuicEpollAlarmFactory(&eps_)),
+ &quic_simple_server_backend_) {
dispatcher_.InitializeWithWriter(new QuicDefaultPacketWriter(1234));
}
diff --git a/quiche/quic/tools/quic_simple_client_stream.h b/quiche/quic/tools/quic_simple_client_stream.h
index a68b7cb..976ceaf 100644
--- a/quiche/quic/tools/quic_simple_client_stream.h
+++ b/quiche/quic/tools/quic_simple_client_stream.h
@@ -11,10 +11,8 @@
class QuicSimpleClientStream : public QuicSpdyClientStream {
public:
- QuicSimpleClientStream(QuicStreamId id,
- QuicSpdyClientSession* session,
- StreamType type,
- bool drop_response_body)
+ QuicSimpleClientStream(QuicStreamId id, QuicSpdyClientSession* session,
+ StreamType type, bool drop_response_body)
: QuicSpdyClientStream(id, session, type),
drop_response_body_(drop_response_body) {}
void OnBodyAvailable() override;
diff --git a/quiche/quic/tools/quic_simple_dispatcher.cc b/quiche/quic/tools/quic_simple_dispatcher.cc
index b820864..247e6f7 100644
--- a/quiche/quic/tools/quic_simple_dispatcher.cc
+++ b/quiche/quic/tools/quic_simple_dispatcher.cc
@@ -10,20 +10,15 @@
namespace quic {
QuicSimpleDispatcher::QuicSimpleDispatcher(
- const QuicConfig* config,
- const QuicCryptoServerConfig* crypto_config,
+ const QuicConfig* config, const QuicCryptoServerConfig* crypto_config,
QuicVersionManager* version_manager,
std::unique_ptr<QuicConnectionHelperInterface> helper,
std::unique_ptr<QuicCryptoServerStreamBase::Helper> session_helper,
std::unique_ptr<QuicAlarmFactory> alarm_factory,
QuicSimpleServerBackend* quic_simple_server_backend,
uint8_t expected_server_connection_id_length)
- : QuicDispatcher(config,
- crypto_config,
- version_manager,
- std::move(helper),
- std::move(session_helper),
- std::move(alarm_factory),
+ : QuicDispatcher(config, crypto_config, version_manager, std::move(helper),
+ std::move(session_helper), std::move(alarm_factory),
expected_server_connection_id_length),
quic_simple_server_backend_(quic_simple_server_backend) {}
diff --git a/quiche/quic/tools/quic_simple_dispatcher.h b/quiche/quic/tools/quic_simple_dispatcher.h
index ee80955..609e210 100644
--- a/quiche/quic/tools/quic_simple_dispatcher.h
+++ b/quiche/quic/tools/quic_simple_dispatcher.h
@@ -15,8 +15,7 @@
class QuicSimpleDispatcher : public QuicDispatcher {
public:
QuicSimpleDispatcher(
- const QuicConfig* config,
- const QuicCryptoServerConfig* crypto_config,
+ const QuicConfig* config, const QuicCryptoServerConfig* crypto_config,
QuicVersionManager* version_manager,
std::unique_ptr<QuicConnectionHelperInterface> helper,
std::unique_ptr<QuicCryptoServerStreamBase::Helper> session_helper,
diff --git a/quiche/quic/tools/quic_simple_server_backend.h b/quiche/quic/tools/quic_simple_server_backend.h
index b0e1d8f..f976e72 100644
--- a/quiche/quic/tools/quic_simple_server_backend.h
+++ b/quiche/quic/tools/quic_simple_server_backend.h
@@ -54,8 +54,7 @@
// asynchronously calls |request_handler| with the HTTP response.
virtual void FetchResponseFromBackend(
const spdy::Http2HeaderBlock& request_headers,
- const std::string& request_body,
- RequestHandler* request_handler) = 0;
+ const std::string& request_body, RequestHandler* request_handler) = 0;
// Clears the state of the backend instance
virtual void CloseBackendResponseStream(RequestHandler* request_handler) = 0;
diff --git a/quiche/quic/tools/quic_simple_server_session.h b/quiche/quic/tools/quic_simple_server_session.h
index 950da18..872a457 100644
--- a/quiche/quic/tools/quic_simple_server_session.h
+++ b/quiche/quic/tools/quic_simple_server_session.h
@@ -117,8 +117,7 @@
// Copying the rest headers ensures they are the same as the original
// request, especially cookies.
spdy::Http2HeaderBlock SynthesizePushRequestHeaders(
- std::string request_url,
- QuicBackendResponse::ServerPushInfo resource,
+ std::string request_url, QuicBackendResponse::ServerPushInfo resource,
const spdy::Http2HeaderBlock& original_request_headers);
// Send PUSH_PROMISE frame on headers stream.
diff --git a/quiche/quic/tools/quic_simple_server_session_test.cc b/quiche/quic/tools/quic_simple_server_session_test.cc
index 2cff502..a5124ea 100644
--- a/quiche/quic/tools/quic_simple_server_session_test.cc
+++ b/quiche/quic/tools/quic_simple_server_session_test.cc
@@ -83,21 +83,16 @@
public:
explicit MockQuicCryptoServerStream(
const QuicCryptoServerConfig* crypto_config,
- QuicCompressedCertsCache* compressed_certs_cache,
- QuicSession* session,
+ QuicCompressedCertsCache* compressed_certs_cache, QuicSession* session,
QuicCryptoServerStreamBase::Helper* helper)
- : QuicCryptoServerStream(crypto_config,
- compressed_certs_cache,
- session,
+ : QuicCryptoServerStream(crypto_config, compressed_certs_cache, session,
helper) {}
MockQuicCryptoServerStream(const MockQuicCryptoServerStream&) = delete;
MockQuicCryptoServerStream& operator=(const MockQuicCryptoServerStream&) =
delete;
~MockQuicCryptoServerStream() override {}
- MOCK_METHOD(void,
- SendServerConfigUpdate,
- (const CachedNetworkParameters*),
+ MOCK_METHOD(void, SendServerConfigUpdate, (const CachedNetworkParameters*),
(override));
bool encryption_established() const override { return true; }
@@ -112,9 +107,7 @@
MockTlsServerHandshaker& operator=(const MockTlsServerHandshaker&) = delete;
~MockTlsServerHandshaker() override {}
- MOCK_METHOD(void,
- SendServerConfigUpdate,
- (const CachedNetworkParameters*),
+ MOCK_METHOD(void, SendServerConfigUpdate, (const CachedNetworkParameters*),
(override));
bool encryption_established() const override { return true; }
@@ -122,8 +115,7 @@
QuicCryptoServerStreamBase* CreateMockCryptoServerStream(
const QuicCryptoServerConfig* crypto_config,
- QuicCompressedCertsCache* compressed_certs_cache,
- QuicSession* session,
+ QuicCompressedCertsCache* compressed_certs_cache, QuicSession* session,
QuicCryptoServerStreamBase::Helper* helper) {
switch (session->connection()->version().handshake_protocol) {
case PROTOCOL_QUIC_CRYPTO:
@@ -143,13 +135,10 @@
class MockQuicConnectionWithSendStreamData : public MockQuicConnection {
public:
MockQuicConnectionWithSendStreamData(
- MockQuicConnectionHelper* helper,
- MockAlarmFactory* alarm_factory,
+ MockQuicConnectionHelper* helper, MockAlarmFactory* alarm_factory,
Perspective perspective,
const ParsedQuicVersionVector& supported_versions)
- : MockQuicConnection(helper,
- alarm_factory,
- perspective,
+ : MockQuicConnection(helper, alarm_factory, perspective,
supported_versions) {
auto consume_all_data = [](QuicStreamId /*id*/, size_t write_length,
QuicStreamOffset /*offset*/,
@@ -160,11 +149,8 @@
.WillByDefault(Invoke(consume_all_data));
}
- MOCK_METHOD(QuicConsumedData,
- SendStreamData,
- (QuicStreamId id,
- size_t write_length,
- QuicStreamOffset offset,
+ MOCK_METHOD(QuicConsumedData, SendStreamData,
+ (QuicStreamId id, size_t write_length, QuicStreamOffset offset,
StreamSendingState state),
(override));
};
@@ -172,21 +158,15 @@
class MockQuicSimpleServerSession : public QuicSimpleServerSession {
public:
MockQuicSimpleServerSession(
- const QuicConfig& config,
- QuicConnection* connection,
- QuicSession::Visitor* visitor,
- QuicCryptoServerStreamBase::Helper* helper,
+ const QuicConfig& config, QuicConnection* connection,
+ QuicSession::Visitor* visitor, QuicCryptoServerStreamBase::Helper* helper,
const QuicCryptoServerConfig* crypto_config,
QuicCompressedCertsCache* compressed_certs_cache,
QuicSimpleServerBackend* quic_simple_server_backend)
- : QuicSimpleServerSession(config,
- CurrentSupportedVersions(),
- connection,
- visitor,
- helper,
- crypto_config,
- compressed_certs_cache,
- quic_simple_server_backend) {}
+ : QuicSimpleServerSession(
+ config, CurrentSupportedVersions(), connection, visitor, helper,
+ crypto_config, compressed_certs_cache, quic_simple_server_backend) {
+ }
// Methods taking non-copyable types like Http2HeaderBlock by value cannot be
// mocked directly.
void WritePushPromise(QuicStreamId original_stream_id,
@@ -195,18 +175,14 @@
return WritePushPromiseMock(original_stream_id, promised_stream_id,
headers);
}
- MOCK_METHOD(void,
- WritePushPromiseMock,
- (QuicStreamId original_stream_id,
- QuicStreamId promised_stream_id,
+ MOCK_METHOD(void, WritePushPromiseMock,
+ (QuicStreamId original_stream_id, QuicStreamId promised_stream_id,
const spdy::Http2HeaderBlock& headers),
());
MOCK_METHOD(void, SendBlocked, (QuicStreamId), (override));
- MOCK_METHOD(bool,
- WriteControlFrame,
- (const QuicFrame& frame, TransmissionType type),
- (override));
+ MOCK_METHOD(bool, WriteControlFrame,
+ (const QuicFrame& frame, TransmissionType type), (override));
};
class QuicSimpleServerSessionTest
@@ -325,8 +301,7 @@
std::unique_ptr<CryptoHandshakeMessage> handshake_message_;
};
-INSTANTIATE_TEST_SUITE_P(Tests,
- QuicSimpleServerSessionTest,
+INSTANTIATE_TEST_SUITE_P(Tests, QuicSimpleServerSessionTest,
::testing::ValuesIn(AllSupportedVersions()),
::testing::PrintToStringParamName());
diff --git a/quiche/quic/tools/quic_simple_server_stream.cc b/quiche/quic/tools/quic_simple_server_stream.cc
index ab9622e..91f91d3 100644
--- a/quiche/quic/tools/quic_simple_server_stream.cc
+++ b/quiche/quic/tools/quic_simple_server_stream.cc
@@ -26,9 +26,7 @@
namespace quic {
QuicSimpleServerStream::QuicSimpleServerStream(
- QuicStreamId id,
- QuicSpdySession* session,
- StreamType type,
+ QuicStreamId id, QuicSpdySession* session, StreamType type,
QuicSimpleServerBackend* quic_simple_server_backend)
: QuicSpdyServerStreamBase(id, session, type),
content_length_(-1),
@@ -52,9 +50,7 @@
}
void QuicSimpleServerStream::OnInitialHeadersComplete(
- bool fin,
- size_t frame_len,
- const QuicHeaderList& header_list) {
+ bool fin, size_t frame_len, const QuicHeaderList& header_list) {
QuicSpdyStream::OnInitialHeadersComplete(fin, frame_len, header_list);
// QuicSpdyStream::OnInitialHeadersComplete() may have already sent error
// response.
@@ -62,7 +58,7 @@
!SpdyUtils::CopyAndValidateHeaders(header_list, &content_length_,
&request_headers_)) {
QUIC_DVLOG(1) << "Invalid headers";
- SendErrorResponse();
+ SendErrorResponse();
}
ConsumeHeaderList();
if (!fin && !response_sent_) {
@@ -78,9 +74,7 @@
}
void QuicSimpleServerStream::OnTrailingHeadersComplete(
- bool /*fin*/,
- size_t /*frame_len*/,
- const QuicHeaderList& /*header_list*/) {
+ bool /*fin*/, size_t /*frame_len*/, const QuicHeaderList& /*header_list*/) {
QUIC_BUG(quic_bug_10962_1) << "Server does not support receiving Trailers.";
SendErrorResponse();
}
@@ -205,9 +199,7 @@
return spdy_session()->connection_id();
}
-QuicStreamId QuicSimpleServerStream::stream_id() const {
- return id();
-}
+QuicStreamId QuicSimpleServerStream::stream_id() const { return id(); }
std::string QuicSimpleServerStream::peer_host() const {
return spdy_session()->peer_address().host().ToString();
@@ -341,9 +333,7 @@
SendHeadersAndBody(std::move(headers), kNotFoundResponseBody);
}
-void QuicSimpleServerStream::SendErrorResponse() {
- SendErrorResponse(0);
-}
+void QuicSimpleServerStream::SendErrorResponse() { SendErrorResponse(0); }
void QuicSimpleServerStream::SendErrorResponse(int resp_code) {
QUIC_DVLOG(1) << "Stream " << id() << " sending error response.";
@@ -361,8 +351,7 @@
}
void QuicSimpleServerStream::SendIncompleteResponse(
- Http2HeaderBlock response_headers,
- absl::string_view body) {
+ Http2HeaderBlock response_headers, absl::string_view body) {
QUIC_DLOG(INFO) << "Stream " << id() << " writing headers (fin = false) : "
<< response_headers.DebugString();
WriteHeaders(std::move(response_headers), /*fin=*/false, nullptr);
@@ -377,15 +366,13 @@
}
void QuicSimpleServerStream::SendHeadersAndBody(
- Http2HeaderBlock response_headers,
- absl::string_view body) {
+ Http2HeaderBlock response_headers, absl::string_view body) {
SendHeadersAndBodyAndTrailers(std::move(response_headers), body,
Http2HeaderBlock());
}
void QuicSimpleServerStream::SendHeadersAndBodyAndTrailers(
- Http2HeaderBlock response_headers,
- absl::string_view body,
+ Http2HeaderBlock response_headers, absl::string_view body,
Http2HeaderBlock response_trailers) {
// Send the headers, with a FIN if there's nothing else to send.
bool send_fin = (body.empty() && response_trailers.empty());
diff --git a/quiche/quic/tools/quic_simple_server_stream.h b/quiche/quic/tools/quic_simple_server_stream.h
index 841437d..f3221c8 100644
--- a/quiche/quic/tools/quic_simple_server_stream.h
+++ b/quiche/quic/tools/quic_simple_server_stream.h
@@ -19,23 +19,19 @@
class QuicSimpleServerStream : public QuicSpdyServerStreamBase,
public QuicSimpleServerBackend::RequestHandler {
public:
- QuicSimpleServerStream(QuicStreamId id,
- QuicSpdySession* session,
+ QuicSimpleServerStream(QuicStreamId id, QuicSpdySession* session,
StreamType type,
QuicSimpleServerBackend* quic_simple_server_backend);
- QuicSimpleServerStream(PendingStream* pending,
- QuicSpdySession* session,
+ QuicSimpleServerStream(PendingStream* pending, QuicSpdySession* session,
QuicSimpleServerBackend* quic_simple_server_backend);
QuicSimpleServerStream(const QuicSimpleServerStream&) = delete;
QuicSimpleServerStream& operator=(const QuicSimpleServerStream&) = delete;
~QuicSimpleServerStream() override;
// QuicSpdyStream
- void OnInitialHeadersComplete(bool fin,
- size_t frame_len,
+ void OnInitialHeadersComplete(bool fin, size_t frame_len,
const QuicHeaderList& header_list) override;
- void OnTrailingHeadersComplete(bool fin,
- size_t frame_len,
+ void OnTrailingHeadersComplete(bool fin, size_t frame_len,
const QuicHeaderList& header_list) override;
void OnCanWrite() override;
diff --git a/quiche/quic/tools/quic_spdy_client_base.cc b/quiche/quic/tools/quic_spdy_client_base.cc
index f61a26d..5ffe571 100644
--- a/quiche/quic/tools/quic_spdy_client_base.cc
+++ b/quiche/quic/tools/quic_spdy_client_base.cc
@@ -25,30 +25,21 @@
}
QuicSpdyClientBase::QuicDataToResend::QuicDataToResend(
- std::unique_ptr<Http2HeaderBlock> headers,
- absl::string_view body,
- bool fin)
+ std::unique_ptr<Http2HeaderBlock> headers, absl::string_view body, bool fin)
: headers_(std::move(headers)), body_(body), fin_(fin) {}
QuicSpdyClientBase::QuicDataToResend::~QuicDataToResend() = default;
QuicSpdyClientBase::QuicSpdyClientBase(
const QuicServerId& server_id,
- const ParsedQuicVersionVector& supported_versions,
- const QuicConfig& config,
- QuicConnectionHelperInterface* helper,
- QuicAlarmFactory* alarm_factory,
+ const ParsedQuicVersionVector& supported_versions, const QuicConfig& config,
+ QuicConnectionHelperInterface* helper, QuicAlarmFactory* alarm_factory,
std::unique_ptr<NetworkHelper> network_helper,
std::unique_ptr<ProofVerifier> proof_verifier,
std::unique_ptr<SessionCache> session_cache)
- : QuicClientBase(server_id,
- supported_versions,
- config,
- helper,
- alarm_factory,
- std::move(network_helper),
- std::move(proof_verifier),
- std::move(session_cache)),
+ : QuicClientBase(server_id, supported_versions, config, helper,
+ alarm_factory, std::move(network_helper),
+ std::move(proof_verifier), std::move(session_cache)),
store_response_(false),
latest_response_code_(-1) {}
@@ -113,8 +104,7 @@
}
void QuicSpdyClientBase::SendRequest(const Http2HeaderBlock& headers,
- absl::string_view body,
- bool fin) {
+ absl::string_view body, bool fin) {
if (GetQuicFlag(FLAGS_quic_client_convert_http_header_name_to_lowercase)) {
QUIC_CODE_COUNT(quic_client_convert_http_header_name_to_lowercase);
Http2HeaderBlock sanitized_headers;
@@ -129,13 +119,11 @@
}
void QuicSpdyClientBase::SendRequestInternal(Http2HeaderBlock sanitized_headers,
- absl::string_view body,
- bool fin) {
+ absl::string_view body, bool fin) {
QuicClientPushPromiseIndex::TryHandle* handle;
QuicAsyncStatus rv =
push_promise_index()->Try(sanitized_headers, this, &handle);
- if (rv == QUIC_SUCCESS)
- return;
+ if (rv == QUIC_SUCCESS) return;
if (rv == QUIC_PENDING) {
// May need to retry request if asynchronous rendezvous fails.
@@ -152,9 +140,7 @@
}
void QuicSpdyClientBase::SendRequestAndWaitForResponse(
- const Http2HeaderBlock& headers,
- absl::string_view body,
- bool fin) {
+ const Http2HeaderBlock& headers, absl::string_view body, bool fin) {
SendRequest(headers, body, fin);
while (WaitForEvents()) {
}
diff --git a/quiche/quic/tools/quic_spdy_client_base.h b/quiche/quic/tools/quic_spdy_client_base.h
index 921718a..a6c4a4a 100644
--- a/quiche/quic/tools/quic_spdy_client_base.h
+++ b/quiche/quic/tools/quic_spdy_client_base.h
@@ -35,8 +35,7 @@
ResponseListener() {}
virtual ~ResponseListener() {}
virtual void OnCompleteResponse(
- QuicStreamId id,
- const spdy::Http2HeaderBlock& response_headers,
+ QuicStreamId id, const spdy::Http2HeaderBlock& response_headers,
const std::string& response_body) = 0;
};
@@ -47,8 +46,7 @@
public:
// |headers| may be null, since it's possible to send data without headers.
QuicDataToResend(std::unique_ptr<spdy::Http2HeaderBlock> headers,
- absl::string_view body,
- bool fin);
+ absl::string_view body, bool fin);
QuicDataToResend(const QuicDataToResend&) = delete;
QuicDataToResend& operator=(const QuicDataToResend&) = delete;
@@ -86,13 +84,11 @@
// Sends an HTTP request and does not wait for response before returning.
void SendRequest(const spdy::Http2HeaderBlock& headers,
- absl::string_view body,
- bool fin);
+ absl::string_view body, bool fin);
// Sends an HTTP request and waits for response before returning.
void SendRequestAndWaitForResponse(const spdy::Http2HeaderBlock& headers,
- absl::string_view body,
- bool fin);
+ absl::string_view body, bool fin);
// Sends a request simple GET for each URL in |url_list|, and then waits for
// each to complete.
@@ -172,8 +168,7 @@
void ResendSavedData() override;
void AddPromiseDataToResend(const spdy::Http2HeaderBlock& headers,
- absl::string_view body,
- bool fin);
+ absl::string_view body, bool fin);
bool HasActiveRequests() override;
private:
@@ -181,8 +176,7 @@
class ClientQuicDataToResend : public QuicDataToResend {
public:
ClientQuicDataToResend(std::unique_ptr<spdy::Http2HeaderBlock> headers,
- absl::string_view body,
- bool fin,
+ absl::string_view body, bool fin,
QuicSpdyClientBase* client)
: QuicDataToResend(std::move(headers), body, fin), client_(client) {
QUICHE_DCHECK(headers_);
@@ -200,8 +194,7 @@
};
void SendRequestInternal(spdy::Http2HeaderBlock sanitized_headers,
- absl::string_view body,
- bool fin);
+ absl::string_view body, bool fin);
// Index of pending promised streams. Must outlive |session_|.
QuicClientPushPromiseIndex push_promise_index_;
diff --git a/quiche/quic/tools/quic_tcp_like_trace_converter.cc b/quiche/quic/tools/quic_tcp_like_trace_converter.cc
index f1ae0c1..b3d5cec 100644
--- a/quiche/quic/tools/quic_tcp_like_trace_converter.cc
+++ b/quiche/quic/tools/quic_tcp_like_trace_converter.cc
@@ -17,8 +17,7 @@
: connection_offset(0) {}
QuicTcpLikeTraceConverter::StreamOffsetSegment::StreamOffsetSegment(
- QuicStreamOffset stream_offset,
- uint64_t connection_offset,
+ QuicStreamOffset stream_offset, uint64_t connection_offset,
QuicByteCount data_length)
: stream_data(stream_offset, stream_offset + data_length),
connection_offset(connection_offset) {}
@@ -26,9 +25,7 @@
QuicTcpLikeTraceConverter::StreamInfo::StreamInfo() : fin(false) {}
QuicIntervalSet<uint64_t> QuicTcpLikeTraceConverter::OnCryptoFrameSent(
- EncryptionLevel level,
- QuicStreamOffset offset,
- QuicByteCount data_length) {
+ EncryptionLevel level, QuicStreamOffset offset, QuicByteCount data_length) {
if (level >= NUM_ENCRYPTION_LEVELS) {
QUIC_BUG(quic_bug_10907_1) << "Invalid encryption level";
return {};
@@ -38,9 +35,7 @@
}
QuicIntervalSet<uint64_t> QuicTcpLikeTraceConverter::OnStreamFrameSent(
- QuicStreamId stream_id,
- QuicStreamOffset offset,
- QuicByteCount data_length,
+ QuicStreamId stream_id, QuicStreamOffset offset, QuicByteCount data_length,
bool fin) {
return OnFrameSent(
offset, data_length, fin,
@@ -48,9 +43,7 @@
}
QuicIntervalSet<uint64_t> QuicTcpLikeTraceConverter::OnFrameSent(
- QuicStreamOffset offset,
- QuicByteCount data_length,
- bool fin,
+ QuicStreamOffset offset, QuicByteCount data_length, bool fin,
StreamInfo* info) {
QuicIntervalSet<uint64_t> connection_offsets;
if (fin) {
@@ -104,8 +97,7 @@
}
QuicInterval<uint64_t> QuicTcpLikeTraceConverter::OnControlFrameSent(
- QuicControlFrameId control_frame_id,
- QuicByteCount control_frame_length) {
+ QuicControlFrameId control_frame_id, QuicByteCount control_frame_length) {
if (control_frame_id > largest_observed_control_frame_id_) {
// New control frame.
QuicInterval<uint64_t> connection_offset = QuicInterval<uint64_t>(
diff --git a/quiche/quic/tools/quic_tcp_like_trace_converter.h b/quiche/quic/tools/quic_tcp_like_trace_converter.h
index 78cbaf9..aa0c0f2 100644
--- a/quiche/quic/tools/quic_tcp_like_trace_converter.h
+++ b/quiche/quic/tools/quic_tcp_like_trace_converter.h
@@ -25,8 +25,7 @@
struct StreamOffsetSegment {
StreamOffsetSegment();
StreamOffsetSegment(QuicStreamOffset stream_offset,
- uint64_t connection_offset,
- QuicByteCount data_length);
+ uint64_t connection_offset, QuicByteCount data_length);
QuicInterval<QuicStreamOffset> stream_data;
uint64_t connection_offset;
@@ -69,8 +68,7 @@
// Called when frame with |offset|, |data_length| and |fin| has been sent.
// Update |info| and returns connection offsets.
QuicIntervalSet<uint64_t> OnFrameSent(QuicStreamOffset offset,
- QuicByteCount data_length,
- bool fin,
+ QuicByteCount data_length, bool fin,
StreamInfo* info);
StreamInfo crypto_frames_info_[NUM_ENCRYPTION_LEVELS];
diff --git a/quiche/quic/tools/quic_toy_client.h b/quiche/quic/tools/quic_toy_client.h
index 5f884f0..7639482 100644
--- a/quiche/quic/tools/quic_toy_client.h
+++ b/quiche/quic/tools/quic_toy_client.h
@@ -22,13 +22,10 @@
// supporting |versions|, using |host_for_handshake| for handshake and
// |verifier| to verify proofs.
virtual std::unique_ptr<QuicSpdyClientBase> CreateClient(
- std::string host_for_handshake,
- std::string host_for_lookup,
+ std::string host_for_handshake, std::string host_for_lookup,
// AF_INET, AF_INET6, or AF_UNSPEC(=don't care).
- int address_family_for_lookup,
- uint16_t port,
- ParsedQuicVersionVector versions,
- const QuicConfig& config,
+ int address_family_for_lookup, uint16_t port,
+ ParsedQuicVersionVector versions, const QuicConfig& config,
std::unique_ptr<ProofVerifier> verifier,
std::unique_ptr<SessionCache> session_cache) = 0;
};
diff --git a/quiche/quic/tools/quic_transport_simple_server_dispatcher.cc b/quiche/quic/tools/quic_transport_simple_server_dispatcher.cc
index 91c7816..7fdcfe9 100644
--- a/quiche/quic/tools/quic_transport_simple_server_dispatcher.cc
+++ b/quiche/quic/tools/quic_transport_simple_server_dispatcher.cc
@@ -16,20 +16,15 @@
namespace quic {
QuicTransportSimpleServerDispatcher::QuicTransportSimpleServerDispatcher(
- const QuicConfig* config,
- const QuicCryptoServerConfig* crypto_config,
+ const QuicConfig* config, const QuicCryptoServerConfig* crypto_config,
QuicVersionManager* version_manager,
std::unique_ptr<QuicConnectionHelperInterface> helper,
std::unique_ptr<QuicCryptoServerStreamBase::Helper> session_helper,
std::unique_ptr<QuicAlarmFactory> alarm_factory,
uint8_t expected_server_connection_id_length,
std::vector<url::Origin> accepted_origins)
- : QuicDispatcher(config,
- crypto_config,
- version_manager,
- std::move(helper),
- std::move(session_helper),
- std::move(alarm_factory),
+ : QuicDispatcher(config, crypto_config, version_manager, std::move(helper),
+ std::move(session_helper), std::move(alarm_factory),
expected_server_connection_id_length),
accepted_origins_(accepted_origins) {}
diff --git a/quiche/quic/tools/quic_transport_simple_server_dispatcher.h b/quiche/quic/tools/quic_transport_simple_server_dispatcher.h
index a70aae1..98562a0 100644
--- a/quiche/quic/tools/quic_transport_simple_server_dispatcher.h
+++ b/quiche/quic/tools/quic_transport_simple_server_dispatcher.h
@@ -17,8 +17,7 @@
class QuicTransportSimpleServerDispatcher : public QuicDispatcher {
public:
QuicTransportSimpleServerDispatcher(
- const QuicConfig* config,
- const QuicCryptoServerConfig* crypto_config,
+ const QuicConfig* config, const QuicCryptoServerConfig* crypto_config,
QuicVersionManager* version_manager,
std::unique_ptr<QuicConnectionHelperInterface> helper,
std::unique_ptr<QuicCryptoServerStreamBase::Helper> session_helper,
diff --git a/quiche/quic/tools/quic_transport_simple_server_session.cc b/quiche/quic/tools/quic_transport_simple_server_session.cc
index 722e131..fcd70ce 100644
--- a/quiche/quic/tools/quic_transport_simple_server_session.cc
+++ b/quiche/quic/tools/quic_transport_simple_server_session.cc
@@ -21,21 +21,13 @@
namespace quic {
QuicTransportSimpleServerSession::QuicTransportSimpleServerSession(
- QuicConnection* connection,
- bool owns_connection,
- Visitor* owner,
- const QuicConfig& config,
- const ParsedQuicVersionVector& supported_versions,
+ QuicConnection* connection, bool owns_connection, Visitor* owner,
+ const QuicConfig& config, const ParsedQuicVersionVector& supported_versions,
const QuicCryptoServerConfig* crypto_config,
QuicCompressedCertsCache* compressed_certs_cache,
std::vector<url::Origin> accepted_origins)
- : QuicTransportServerSession(connection,
- owner,
- config,
- supported_versions,
- crypto_config,
- compressed_certs_cache,
- this),
+ : QuicTransportServerSession(connection, owner, config, supported_versions,
+ crypto_config, compressed_certs_cache, this),
owns_connection_(owns_connection),
mode_(DISCARD),
accepted_origins_(accepted_origins) {}
diff --git a/quiche/quic/tools/quic_transport_simple_server_session.h b/quiche/quic/tools/quic_transport_simple_server_session.h
index f5c3934..4d59f90 100644
--- a/quiche/quic/tools/quic_transport_simple_server_session.h
+++ b/quiche/quic/tools/quic_transport_simple_server_session.h
@@ -44,9 +44,7 @@
};
QuicTransportSimpleServerSession(
- QuicConnection* connection,
- bool owns_connection,
- Visitor* owner,
+ QuicConnection* connection, bool owns_connection, Visitor* owner,
const QuicConfig& config,
const ParsedQuicVersionVector& supported_versions,
const QuicCryptoServerConfig* crypto_config,