Index: net/quic/test_tools/crypto_test_utils.cc |
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc |
index ef27df0338aa286ae04731264ae51d73c96e59a2..ddd7567c82c3abd56f7e991fe48ed7c09a7df4a6 100644 |
--- a/net/quic/test_tools/crypto_test_utils.cc |
+++ b/net/quic/test_tools/crypto_test_utils.cc |
@@ -37,9 +37,7 @@ const uint16 kServerPort = 80; |
// CryptoFramerVisitor is a framer visitor that records handshake messages. |
class CryptoFramerVisitor : public CryptoFramerVisitorInterface { |
public: |
- CryptoFramerVisitor() |
- : error_(false) { |
- } |
+ CryptoFramerVisitor() : error_(false) {} |
virtual void OnError(CryptoFramer* framer) OVERRIDE { error_ = true; } |
@@ -48,13 +46,9 @@ class CryptoFramerVisitor : public CryptoFramerVisitorInterface { |
messages_.push_back(message); |
} |
- bool error() const { |
- return error_; |
- } |
+ bool error() const { return error_; } |
- const vector<CryptoHandshakeMessage>& messages() const { |
- return messages_; |
- } |
+ const vector<CryptoHandshakeMessage>& messages() const { return messages_; } |
private: |
bool error_; |
@@ -66,7 +60,7 @@ class CryptoFramerVisitor : public CryptoFramerVisitorInterface { |
// process them. |*inout_packet_index| is updated with an index one greater |
// than the last packet processed. |
void MovePackets(PacketSavingConnection* source_conn, |
- size_t *inout_packet_index, |
+ size_t* inout_packet_index, |
QuicCryptoStream* dest_stream, |
PacketSavingConnection* dest_conn) { |
SimpleQuicFramer framer(source_conn->supported_versions()); |
@@ -85,9 +79,10 @@ void MovePackets(PacketSavingConnection* source_conn, |
size_t index = *inout_packet_index; |
for (; index < source_conn->encrypted_packets_.size(); index++) { |
ASSERT_TRUE(framer.ProcessPacket(*source_conn->encrypted_packets_[index])); |
- for (vector<QuicStreamFrame>::const_iterator |
- i = framer.stream_frames().begin(); |
- i != framer.stream_frames().end(); ++i) { |
+ for (vector<QuicStreamFrame>::const_iterator i = |
+ framer.stream_frames().begin(); |
+ i != framer.stream_frames().end(); |
+ ++i) { |
scoped_ptr<string> frame_data(i->GetDataAsString()); |
ASSERT_TRUE(crypto_framer.ProcessInput(*frame_data)); |
ASSERT_FALSE(crypto_visitor.error()); |
@@ -99,9 +94,10 @@ void MovePackets(PacketSavingConnection* source_conn, |
ASSERT_EQ(0u, crypto_framer.InputBytesRemaining()); |
- for (vector<CryptoHandshakeMessage>::const_iterator |
- i = crypto_visitor.messages().begin(); |
- i != crypto_visitor.messages().end(); ++i) { |
+ for (vector<CryptoHandshakeMessage>::const_iterator i = |
+ crypto_visitor.messages().begin(); |
+ i != crypto_visitor.messages().end(); |
+ ++i) { |
dest_stream->OnHandshakeMessage(*i); |
} |
} |
@@ -127,8 +123,7 @@ bool HexChar(char c, uint8* value) { |
} // anonymous namespace |
CryptoTestUtils::FakeClientOptions::FakeClientOptions() |
- : dont_verify_certs(false), |
- channel_id_enabled(false) { |
+ : dont_verify_certs(false), channel_id_enabled(false) { |
} |
// static |
@@ -144,7 +139,8 @@ int CryptoTestUtils::HandshakeWithFakeServer( |
SetupCryptoServerConfigForTest( |
server_session.connection()->clock(), |
server_session.connection()->random_generator(), |
- server_session.config(), &crypto_config); |
+ server_session.config(), |
+ &crypto_config); |
QuicCryptoServerStream server(crypto_config, &server_session); |
server_session.SetCryptoStream(&server); |
@@ -177,10 +173,10 @@ int CryptoTestUtils::HandshakeWithFakeClient( |
if (options.channel_id_enabled) { |
crypto_config.SetChannelIDSigner(ChannelIDSignerForTesting()); |
} |
- QuicServerId server_id(kServerHostname, kServerPort, false, |
- PRIVACY_MODE_DISABLED); |
- QuicCryptoClientStream client(server_id, &client_session, NULL, |
- &crypto_config); |
+ QuicServerId server_id( |
+ kServerHostname, kServerPort, false, PRIVACY_MODE_DISABLED); |
+ QuicCryptoClientStream client( |
+ server_id, &client_session, NULL, &crypto_config); |
client_session.SetCryptoStream(&client); |
CHECK(client.CryptoConnect()); |
@@ -270,10 +266,7 @@ string CryptoTestUtils::GetValueForTag(const CryptoHandshakeMessage& message, |
class MockCommonCertSets : public CommonCertSets { |
public: |
MockCommonCertSets(StringPiece cert, uint64 hash, uint32 index) |
- : cert_(cert.as_string()), |
- hash_(hash), |
- index_(index) { |
- } |
+ : cert_(cert.as_string()), hash_(hash), index_(index) {} |
virtual StringPiece GetCommonHashes() const OVERRIDE { |
CHECK(false) << "not implemented"; |
@@ -424,7 +417,7 @@ QuicTag CryptoTestUtils::ParseTag(const char* tagstr) { |
QuicTag tag = 0; |
if (tagstr[0] == '#') { |
- CHECK_EQ(static_cast<size_t>(1 + 2*4), len); |
+ CHECK_EQ(static_cast<size_t>(1 + 2 * 4), len); |
tagstr++; |
for (size_t i = 0; i < 8; i++) { |
@@ -493,18 +486,18 @@ CryptoHandshakeMessage CryptoTestUtils::BuildMessage(const char* message_tag, |
len--; |
CHECK_EQ(0u, len % 2); |
- scoped_ptr<uint8[]> buf(new uint8[len/2]); |
+ scoped_ptr<uint8[]> buf(new uint8[len / 2]); |
- for (size_t i = 0; i < len/2; i++) { |
+ for (size_t i = 0; i < len / 2; i++) { |
uint8 v = 0; |
- CHECK(HexChar(valuestr[i*2], &v)); |
+ CHECK(HexChar(valuestr[i * 2], &v)); |
buf[i] = v << 4; |
- CHECK(HexChar(valuestr[i*2 + 1], &v)); |
+ CHECK(HexChar(valuestr[i * 2 + 1], &v)); |
buf[i] |= v; |
} |
msg.SetStringPiece( |
- tag, StringPiece(reinterpret_cast<char*>(buf.get()), len/2)); |
+ tag, StringPiece(reinterpret_cast<char*>(buf.get()), len / 2)); |
continue; |
} |