summaryrefslogtreecommitdiffstats
path: root/net/tools
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-10-27 14:58:51 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-27 21:59:04 +0000
commitff0bb8c4fe2ec9f2c2f27f3ffe0afefb986ef666 (patch)
tree9ea098564d62a2a6047bde7ecf1287e32ea9871d /net/tools
parent0a5ed8fe9450d16d1a5a6a9be7a96be2e7179a14 (diff)
downloadchromium_src-ff0bb8c4fe2ec9f2c2f27f3ffe0afefb986ef666.zip
chromium_src-ff0bb8c4fe2ec9f2c2f27f3ffe0afefb986ef666.tar.gz
chromium_src-ff0bb8c4fe2ec9f2c2f27f3ffe0afefb986ef666.tar.bz2
Standardize usage of virtual/override/final specifiers.
The Google C++ style guide states: Explicitly annotate overrides of virtual functions or virtual destructors with an override or (less frequently) final specifier. Older (pre-C++11) code will use the virtual keyword as an inferior alternative annotation. For clarity, use exactly one of override, final, or virtual when declaring an override. To better conform to these guidelines, the following constructs have been rewritten: - if a base class has a virtual destructor, then: virtual ~Foo(); -> ~Foo() override; - virtual void Foo() override; -> void Foo() override; - virtual void Foo() override final; -> void Foo() final; This patch was automatically generated. The clang plugin can generate fixit hints, which are suggested edits when it is 100% sure it knows how to fix a problem. The hints from the clang plugin were applied to the source tree using the tool in https://codereview.chromium.org/598073004. BUG=417463 R=rch@chromium.org Review URL: https://codereview.chromium.org/678073004 Cr-Commit-Position: refs/heads/master@{#301457}
Diffstat (limited to 'net/tools')
-rw-r--r--net/tools/balsa/balsa_frame_test.cc2
-rw-r--r--net/tools/balsa/balsa_headers_test.cc6
-rw-r--r--net/tools/balsa/noop_balsa_visitor.h65
-rw-r--r--net/tools/epoll_server/epoll_server.cc10
-rw-r--r--net/tools/epoll_server/epoll_server.h12
-rw-r--r--net/tools/quic/end_to_end_test.cc32
-rw-r--r--net/tools/quic/quic_client.h20
-rw-r--r--net/tools/quic/quic_client_session.h13
-rw-r--r--net/tools/quic/quic_default_packet_writer.h16
-rw-r--r--net/tools/quic/quic_dispatcher.cc63
-rw-r--r--net/tools/quic/quic_dispatcher.h26
-rw-r--r--net/tools/quic/quic_dispatcher_test.cc19
-rw-r--r--net/tools/quic/quic_epoll_clock.h6
-rw-r--r--net/tools/quic/quic_epoll_connection_helper.cc6
-rw-r--r--net/tools/quic/quic_epoll_connection_helper.h8
-rw-r--r--net/tools/quic/quic_epoll_connection_helper_test.cc2
-rw-r--r--net/tools/quic/quic_in_memory_cache.cc22
-rw-r--r--net/tools/quic/quic_in_memory_cache_test.cc4
-rw-r--r--net/tools/quic/quic_packet_writer_wrapper.h17
-rw-r--r--net/tools/quic/quic_per_connection_packet_writer.h16
-rw-r--r--net/tools/quic/quic_server.h14
-rw-r--r--net/tools/quic/quic_server_session.h16
-rw-r--r--net/tools/quic/quic_spdy_client_stream.h10
-rw-r--r--net/tools/quic/quic_spdy_server_stream.h6
-rw-r--r--net/tools/quic/quic_time_wait_list_manager.cc2
-rw-r--r--net/tools/quic/quic_time_wait_list_manager.h4
-rw-r--r--net/tools/quic/quic_time_wait_list_manager_test.cc5
-rw-r--r--net/tools/quic/test_tools/mock_epoll_server.h22
-rw-r--r--net/tools/quic/test_tools/packet_dropping_test_writer.cc6
-rw-r--r--net/tools/quic/test_tools/packet_dropping_test_writer.h15
-rw-r--r--net/tools/quic/test_tools/quic_test_client.cc17
-rw-r--r--net/tools/quic/test_tools/quic_test_client.h76
-rw-r--r--net/tools/quic/test_tools/quic_test_utils.cc5
-rw-r--r--net/tools/quic/test_tools/quic_test_utils.h17
-rw-r--r--net/tools/quic/test_tools/server_thread.h4
35 files changed, 267 insertions, 317 deletions
diff --git a/net/tools/balsa/balsa_frame_test.cc b/net/tools/balsa/balsa_frame_test.cc
index 334f5ef..4a00a66 100644
--- a/net/tools/balsa/balsa_frame_test.cc
+++ b/net/tools/balsa/balsa_frame_test.cc
@@ -58,7 +58,7 @@ class Visitor : public BalsaVisitorInterface {
class BalsaFrameTest : public ::testing::Test {
public:
- virtual void SetUp() override {
+ void SetUp() override {
frame_.reset(new BalsaFrame);
frame_headers_.reset(new BalsaHeaders);
visitor_.reset(new Visitor);
diff --git a/net/tools/balsa/balsa_headers_test.cc b/net/tools/balsa/balsa_headers_test.cc
index b1479c6..3dc8eb3 100644
--- a/net/tools/balsa/balsa_headers_test.cc
+++ b/net/tools/balsa/balsa_headers_test.cc
@@ -19,7 +19,7 @@ using ::base::StringPiece;
class BalsaBufferTest : public ::testing::Test {
public:
- virtual void SetUp() override {
+ void SetUp() override {
buffer_.reset(new BalsaBuffer);
anotherBuffer_.reset(new BalsaBuffer);
}
@@ -33,9 +33,7 @@ namespace {
class BalsaHeadersTest: public ::testing::Test {
public:
- virtual void SetUp() override {
- headers_.reset(new BalsaHeaders);
- }
+ void SetUp() override { headers_.reset(new BalsaHeaders); }
protected:
scoped_ptr<BalsaHeaders> headers_;
diff --git a/net/tools/balsa/noop_balsa_visitor.h b/net/tools/balsa/noop_balsa_visitor.h
index c47b0b3..89e9719 100644
--- a/net/tools/balsa/noop_balsa_visitor.h
+++ b/net/tools/balsa/noop_balsa_visitor.h
@@ -17,39 +17,38 @@ namespace net {
class NoOpBalsaVisitor : public BalsaVisitorInterface {
public:
NoOpBalsaVisitor() { }
- virtual ~NoOpBalsaVisitor() { }
-
- virtual void ProcessBodyInput(const char* input, size_t size) override { }
- virtual void ProcessBodyData(const char* input, size_t size) override { }
- virtual void ProcessHeaderInput(const char* input, size_t size) override { }
- virtual void ProcessTrailerInput(const char* input, size_t size) override { }
- virtual void ProcessHeaders(const BalsaHeaders& headers) override { }
-
- virtual void ProcessRequestFirstLine(const char* line_input,
- size_t line_length,
- const char* method_input,
- size_t method_length,
- const char* request_uri_input,
- size_t request_uri_length,
- const char* version_input,
- size_t version_length) override { }
- virtual void ProcessResponseFirstLine(const char* line_input,
- size_t line_length,
- const char* version_input,
- size_t version_length,
- const char* status_input,
- size_t status_length,
- const char* reason_input,
- size_t reason_length) override { }
- virtual void ProcessChunkLength(size_t chunk_length) override { }
- virtual void ProcessChunkExtensions(const char* input, size_t size) override {
- }
- virtual void HeaderDone() override { }
- virtual void MessageDone() override { }
- virtual void HandleHeaderError(BalsaFrame* framer) override { }
- virtual void HandleHeaderWarning(BalsaFrame* framer) override { }
- virtual void HandleChunkingError(BalsaFrame* framer) override { }
- virtual void HandleBodyError(BalsaFrame* framer) override { }
+ ~NoOpBalsaVisitor() override {}
+
+ void ProcessBodyInput(const char* input, size_t size) override {}
+ void ProcessBodyData(const char* input, size_t size) override {}
+ void ProcessHeaderInput(const char* input, size_t size) override {}
+ void ProcessTrailerInput(const char* input, size_t size) override {}
+ void ProcessHeaders(const BalsaHeaders& headers) override {}
+
+ void ProcessRequestFirstLine(const char* line_input,
+ size_t line_length,
+ const char* method_input,
+ size_t method_length,
+ const char* request_uri_input,
+ size_t request_uri_length,
+ const char* version_input,
+ size_t version_length) override {}
+ void ProcessResponseFirstLine(const char* line_input,
+ size_t line_length,
+ const char* version_input,
+ size_t version_length,
+ const char* status_input,
+ size_t status_length,
+ const char* reason_input,
+ size_t reason_length) override {}
+ void ProcessChunkLength(size_t chunk_length) override {}
+ void ProcessChunkExtensions(const char* input, size_t size) override {}
+ void HeaderDone() override {}
+ void MessageDone() override {}
+ void HandleHeaderError(BalsaFrame* framer) override {}
+ void HandleHeaderWarning(BalsaFrame* framer) override {}
+ void HandleChunkingError(BalsaFrame* framer) override {}
+ void HandleBodyError(BalsaFrame* framer) override {}
private:
DISALLOW_COPY_AND_ASSIGN(NoOpBalsaVisitor);
diff --git a/net/tools/epoll_server/epoll_server.cc b/net/tools/epoll_server/epoll_server.cc
index 7ccae1d..72bb0db 100644
--- a/net/tools/epoll_server/epoll_server.cc
+++ b/net/tools/epoll_server/epoll_server.cc
@@ -60,7 +60,7 @@ namespace net {
// Clears the pipe and returns. Used for waking the epoll server up.
class ReadPipeCallback : public EpollCallbackInterface {
public:
- virtual void OnEvent(int fd, EpollEvent* event) override {
+ void OnEvent(int fd, EpollEvent* event) override {
DCHECK(event->in_events == EPOLLIN);
int data;
int data_read = 1;
@@ -69,10 +69,10 @@ class ReadPipeCallback : public EpollCallbackInterface {
data_read = read(fd, &data, sizeof(data));
}
}
- virtual void OnShutdown(EpollServer *eps, int fd) override {}
- virtual void OnRegistration(EpollServer*, int, int) override {}
- virtual void OnModification(int, int) override {} // COV_NF_LINE
- virtual void OnUnregistration(int, bool) override {} // COV_NF_LINE
+ void OnShutdown(EpollServer* eps, int fd) override {}
+ void OnRegistration(EpollServer*, int, int) override {}
+ void OnModification(int, int) override {} // COV_NF_LINE
+ void OnUnregistration(int, bool) override {} // COV_NF_LINE
};
////////////////////////////////////////////////////////////////////////////////
diff --git a/net/tools/epoll_server/epoll_server.h b/net/tools/epoll_server/epoll_server.h
index e8f1396..92d6555 100644
--- a/net/tools/epoll_server/epoll_server.h
+++ b/net/tools/epoll_server/epoll_server.h
@@ -1019,21 +1019,21 @@ class EpollAlarm : public EpollAlarmCallbackInterface {
public:
EpollAlarm();
- virtual ~EpollAlarm();
+ ~EpollAlarm() override;
// Marks the alarm as unregistered and returns 0. The return value may be
// safely ignored by subclasses.
- virtual int64 OnAlarm() override;
+ int64 OnAlarm() override;
// Marks the alarm as registered, and stores the token.
- virtual void OnRegistration(const EpollServer::AlarmRegToken& token,
- EpollServer* eps) override;
+ void OnRegistration(const EpollServer::AlarmRegToken& token,
+ EpollServer* eps) override;
// Marks the alarm as unregistered.
- virtual void OnUnregistration() override;
+ void OnUnregistration() override;
// Marks the alarm as unregistered.
- virtual void OnShutdown(EpollServer* eps) override;
+ void OnShutdown(EpollServer* eps) override;
// If the alarm was registered, unregister it.
void UnregisterIfRegistered();
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index edcd0ce..abf0bab 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -158,11 +158,12 @@ class ServerDelegate : public PacketDroppingTestWriter::Delegate {
QuicDispatcher* dispatcher)
: writer_factory_(writer_factory),
dispatcher_(dispatcher) {}
- virtual ~ServerDelegate() {}
- virtual void OnPacketSent(WriteResult result) override {
+ ~ServerDelegate() override {}
+ void OnPacketSent(WriteResult result) override {
writer_factory_->OnPacketSent(result);
}
- virtual void OnCanWrite() override { dispatcher_->OnCanWrite(); }
+ void OnCanWrite() override { dispatcher_->OnCanWrite(); }
+
private:
TestWriterFactory* writer_factory_;
QuicDispatcher* dispatcher_;
@@ -171,9 +172,9 @@ class ServerDelegate : public PacketDroppingTestWriter::Delegate {
class ClientDelegate : public PacketDroppingTestWriter::Delegate {
public:
explicit ClientDelegate(QuicClient* client) : client_(client) {}
- virtual ~ClientDelegate() {}
- virtual void OnPacketSent(WriteResult result) override {}
- virtual void OnCanWrite() override {
+ ~ClientDelegate() override {}
+ void OnPacketSent(WriteResult result) override {}
+ void OnCanWrite() override {
EpollEvent event(EPOLLOUT, false);
client_->OnEvent(client_->fd(), &event);
}
@@ -320,16 +321,14 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
return client_->client()->connected();
}
- virtual void SetUp() override {
+ void SetUp() override {
// The ownership of these gets transferred to the QuicPacketWriterWrapper
// and TestWriterFactory when Initialize() is executed.
client_writer_ = new PacketDroppingTestWriter();
server_writer_ = new PacketDroppingTestWriter();
}
- virtual void TearDown() override {
- StopServer();
- }
+ void TearDown() override { StopServer(); }
void StartServer() {
server_thread_.reset(
@@ -1102,19 +1101,16 @@ class WrongAddressWriter : public QuicPacketWriterWrapper {
self_address_ = IPEndPoint(ip, 0);
}
- virtual WriteResult WritePacket(
- const char* buffer,
- size_t buf_len,
- const IPAddressNumber& real_self_address,
- const IPEndPoint& peer_address) override {
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& real_self_address,
+ const IPEndPoint& peer_address) override {
// Use wrong address!
return QuicPacketWriterWrapper::WritePacket(
buffer, buf_len, self_address_.address(), peer_address);
}
- virtual bool IsWriteBlockedDataBuffered() const override {
- return false;
- }
+ bool IsWriteBlockedDataBuffered() const override { return false; }
IPEndPoint self_address_;
};
diff --git a/net/tools/quic/quic_client.h b/net/tools/quic/quic_client.h
index ae5c2d9..035f70c 100644
--- a/net/tools/quic/quic_client.h
+++ b/net/tools/quic/quic_client.h
@@ -61,7 +61,7 @@ class QuicClient : public EpollCallbackInterface,
const QuicConfig& config,
EpollServer* epoll_server);
- virtual ~QuicClient();
+ ~QuicClient() override;
// Initializes the client to create a connection. Should be called exactly
// once before calling StartConnect or Connect. Returns true if the
@@ -105,19 +105,17 @@ class QuicClient : public EpollCallbackInterface,
bool WaitForEvents();
// From EpollCallbackInterface
- virtual void OnRegistration(EpollServer* eps,
- int fd,
- int event_mask) override {}
- virtual void OnModification(int fd, int event_mask) override {}
- virtual void OnEvent(int fd, EpollEvent* event) override;
+ void OnRegistration(EpollServer* eps, int fd, int event_mask) override {}
+ void OnModification(int fd, int event_mask) override {}
+ void OnEvent(int fd, EpollEvent* event) override;
// |fd_| can be unregistered without the client being disconnected. This
// happens in b3m QuicProber where we unregister |fd_| to feed in events to
// the client from the SelectServer.
- virtual void OnUnregistration(int fd, bool replaced) override {}
- virtual void OnShutdown(EpollServer* eps, int fd) override {}
+ void OnUnregistration(int fd, bool replaced) override {}
+ void OnShutdown(EpollServer* eps, int fd) override {}
// QuicDataStream::Visitor
- virtual void OnClose(QuicDataStream* stream) override;
+ void OnClose(QuicDataStream* stream) override;
QuicClientSession* session() { return session_.get(); }
@@ -192,9 +190,9 @@ class QuicClient : public EpollCallbackInterface,
class DummyPacketWriterFactory : public QuicConnection::PacketWriterFactory {
public:
DummyPacketWriterFactory(QuicPacketWriter* writer);
- virtual ~DummyPacketWriterFactory();
+ ~DummyPacketWriterFactory() override;
- virtual QuicPacketWriter* Create(QuicConnection* connection) const override;
+ QuicPacketWriter* Create(QuicConnection* connection) const override;
private:
QuicPacketWriter* writer_;
diff --git a/net/tools/quic/quic_client_session.h b/net/tools/quic/quic_client_session.h
index 5e0624a..15dd1c8 100644
--- a/net/tools/quic/quic_client_session.h
+++ b/net/tools/quic/quic_client_session.h
@@ -26,20 +26,19 @@ namespace tools {
class QuicClientSession : public QuicClientSessionBase {
public:
QuicClientSession(const QuicConfig& config, QuicConnection* connection);
- virtual ~QuicClientSession();
+ ~QuicClientSession() override;
// QuicClientSessionBase methods:
- virtual void OnProofValid(
- const QuicCryptoClientConfig::CachedState& cached) override;
- virtual void OnProofVerifyDetailsAvailable(
+ void OnProofValid(const QuicCryptoClientConfig::CachedState& cached) override;
+ void OnProofVerifyDetailsAvailable(
const ProofVerifyDetails& verify_details) override;
void InitializeSession(const QuicServerId& server_id,
QuicCryptoClientConfig* config);
// QuicSession methods:
- virtual QuicSpdyClientStream* CreateOutgoingDataStream() override;
- virtual QuicCryptoClientStream* GetCryptoStream() override;
+ QuicSpdyClientStream* CreateOutgoingDataStream() override;
+ QuicCryptoClientStream* GetCryptoStream() override;
// Performs a crypto handshake with the server. Returns true if the crypto
// handshake is started successfully.
@@ -52,7 +51,7 @@ class QuicClientSession : public QuicClientSessionBase {
protected:
// QuicSession methods:
- virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
+ QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
private:
scoped_ptr<QuicCryptoClientStream> crypto_stream_;
diff --git a/net/tools/quic/quic_default_packet_writer.h b/net/tools/quic/quic_default_packet_writer.h
index 47925c3..3f37fb4 100644
--- a/net/tools/quic/quic_default_packet_writer.h
+++ b/net/tools/quic/quic_default_packet_writer.h
@@ -19,16 +19,16 @@ namespace tools {
class QuicDefaultPacketWriter : public QuicPacketWriter {
public:
explicit QuicDefaultPacketWriter(int fd);
- virtual ~QuicDefaultPacketWriter();
+ ~QuicDefaultPacketWriter() override;
// QuicPacketWriter
- virtual WriteResult WritePacket(const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override;
- virtual bool IsWriteBlockedDataBuffered() const override;
- virtual bool IsWriteBlocked() const override;
- virtual void SetWritable() override;
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
+ bool IsWriteBlockedDataBuffered() const override;
+ bool IsWriteBlocked() const override;
+ void SetWritable() override;
void set_fd(int fd) { fd_ = fd; }
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc
index 5f0e2da..747785e 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -32,7 +32,7 @@ class DeleteSessionsAlarm : public EpollAlarm {
: dispatcher_(dispatcher) {
}
- virtual int64 OnAlarm() override {
+ int64 OnAlarm() override {
EpollAlarm::OnAlarm();
dispatcher_->DeleteSessions();
return 0;
@@ -49,23 +49,21 @@ class QuicDispatcher::QuicFramerVisitor : public QuicFramerVisitorInterface {
connection_id_(0) {}
// QuicFramerVisitorInterface implementation
- virtual void OnPacket() override {}
- virtual bool OnUnauthenticatedPublicHeader(
+ void OnPacket() override {}
+ bool OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header) override {
connection_id_ = header.connection_id;
return dispatcher_->OnUnauthenticatedPublicHeader(header);
}
- virtual bool OnUnauthenticatedHeader(
- const QuicPacketHeader& header) override {
+ bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override {
dispatcher_->OnUnauthenticatedHeader(header);
return false;
}
- virtual void OnError(QuicFramer* framer) override {
+ void OnError(QuicFramer* framer) override {
DVLOG(1) << QuicUtils::ErrorToString(framer->error());
}
- virtual bool OnProtocolVersionMismatch(
- QuicVersion /*received_version*/) override {
+ bool OnProtocolVersionMismatch(QuicVersion /*received_version*/) override {
if (dispatcher_->time_wait_list_manager()->IsConnectionIdInTimeWait(
connection_id_)) {
// Keep processing after protocol mismatch - this will be dealt with by
@@ -81,77 +79,66 @@ class QuicDispatcher::QuicFramerVisitor : public QuicFramerVisitorInterface {
// The following methods should never get called because we always return
// false from OnUnauthenticatedHeader(). As a result, we never process the
// payload of the packet.
- virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& /*packet*/) override {
+ void OnPublicResetPacket(const QuicPublicResetPacket& /*packet*/) override {
DCHECK(false);
}
- virtual void OnVersionNegotiationPacket(
+ void OnVersionNegotiationPacket(
const QuicVersionNegotiationPacket& /*packet*/) override {
DCHECK(false);
}
- virtual void OnDecryptedPacket(EncryptionLevel level) override {
- DCHECK(false);
- }
- virtual bool OnPacketHeader(const QuicPacketHeader& /*header*/) override {
+ void OnDecryptedPacket(EncryptionLevel level) override { DCHECK(false); }
+ bool OnPacketHeader(const QuicPacketHeader& /*header*/) override {
DCHECK(false);
return false;
}
- virtual void OnRevivedPacket() override {
- DCHECK(false);
- }
- virtual void OnFecProtectedPayload(StringPiece /*payload*/) override {
+ void OnRevivedPacket() override { DCHECK(false); }
+ void OnFecProtectedPayload(StringPiece /*payload*/) override {
DCHECK(false);
}
- virtual bool OnStreamFrame(const QuicStreamFrame& /*frame*/) override {
+ bool OnStreamFrame(const QuicStreamFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnAckFrame(const QuicAckFrame& /*frame*/) override {
+ bool OnAckFrame(const QuicAckFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnCongestionFeedbackFrame(
+ bool OnCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnStopWaitingFrame(
- const QuicStopWaitingFrame& /*frame*/) override {
+ bool OnStopWaitingFrame(const QuicStopWaitingFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnPingFrame(const QuicPingFrame& /*frame*/) override {
+ bool OnPingFrame(const QuicPingFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) override {
+ bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame & /*frame*/) override {
+ bool OnConnectionCloseFrame(
+ const QuicConnectionCloseFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) override {
+ bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& /*frame*/)
- override {
+ bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
+ bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
DCHECK(false);
return false;
}
- virtual void OnFecData(const QuicFecData& /*fec*/) override {
- DCHECK(false);
- }
- virtual void OnPacketComplete() override {
- DCHECK(false);
- }
+ void OnFecData(const QuicFecData& /*fec*/) override { DCHECK(false); }
+ void OnPacketComplete() override { DCHECK(false); }
private:
QuicDispatcher* dispatcher_;
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h
index 8b0ab6d..fc557c4 100644
--- a/net/tools/quic/quic_dispatcher.h
+++ b/net/tools/quic/quic_dispatcher.h
@@ -64,11 +64,10 @@ class QuicDispatcher : public QuicServerSessionVisitor,
// Creates ordinary QuicPerConnectionPacketWriter instances.
class DefaultPacketWriterFactory : public PacketWriterFactory {
public:
- virtual ~DefaultPacketWriterFactory() {}
+ ~DefaultPacketWriterFactory() override {}
- virtual QuicPacketWriter* Create(
- QuicPacketWriter* writer,
- QuicConnection* connection) override;
+ QuicPacketWriter* Create(QuicPacketWriter* writer,
+ QuicConnection* connection) override;
};
// Ideally we'd have a linked_hash_set: the boolean is unused.
@@ -84,15 +83,15 @@ class QuicDispatcher : public QuicServerSessionVisitor,
PacketWriterFactory* packet_writer_factory,
EpollServer* epoll_server);
- virtual ~QuicDispatcher();
+ ~QuicDispatcher() override;
virtual void Initialize(int fd);
// Process the incoming packet by creating a new session, passing it to
// an existing session, or passing it to the TimeWaitListManager.
- virtual void ProcessPacket(const IPEndPoint& server_address,
- const IPEndPoint& client_address,
- const QuicEncryptedPacket& packet) override;
+ void ProcessPacket(const IPEndPoint& server_address,
+ const IPEndPoint& client_address,
+ const QuicEncryptedPacket& packet) override;
// Called when the socket becomes writable to allow queued writes to happen.
virtual void OnCanWrite();
@@ -105,12 +104,11 @@ class QuicDispatcher : public QuicServerSessionVisitor,
// QuicServerSessionVisitor interface implementation:
// Ensure that the closed connection is cleaned up asynchronously.
- virtual void OnConnectionClosed(QuicConnectionId connection_id,
- QuicErrorCode error) override;
+ void OnConnectionClosed(QuicConnectionId connection_id,
+ QuicErrorCode error) override;
// Queues the blocked writer for later resumption.
- virtual void OnWriteBlocked(
- QuicBlockedWriterInterface* blocked_writer) override;
+ void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) override;
typedef base::hash_map<QuicConnectionId, QuicSession*> SessionMap;
@@ -191,9 +189,9 @@ class QuicDispatcher : public QuicServerSessionVisitor,
public QuicConnection::PacketWriterFactory {
public:
PacketWriterFactoryAdapter(QuicDispatcher* dispatcher);
- virtual ~PacketWriterFactoryAdapter ();
+ ~PacketWriterFactoryAdapter() override;
- virtual QuicPacketWriter* Create(QuicConnection* connection) const override;
+ QuicPacketWriter* Create(QuicConnection* connection) const override;
private:
QuicDispatcher* dispatcher_;
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
index bcbeb6a..45cddb0 100644
--- a/net/tools/quic/quic_dispatcher_test.cc
+++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -107,7 +107,7 @@ class QuicDispatcherTest : public ::testing::Test {
dispatcher_.Initialize(1);
}
- virtual ~QuicDispatcherTest() {}
+ ~QuicDispatcherTest() override {}
MockConnection* connection1() {
return reinterpret_cast<MockConnection*>(session1_->connection());
@@ -264,14 +264,13 @@ class BlockingWriter : public QuicPacketWriterWrapper {
public:
BlockingWriter() : write_blocked_(false) {}
- virtual bool IsWriteBlocked() const override { return write_blocked_; }
- virtual void SetWritable() override { write_blocked_ = false; }
+ bool IsWriteBlocked() const override { return write_blocked_; }
+ void SetWritable() override { write_blocked_ = false; }
- virtual WriteResult WritePacket(
- const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_client_address,
- const IPEndPoint& peer_client_address) override {
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_client_address,
+ const IPEndPoint& peer_client_address) override {
// It would be quite possible to actually implement this method here with
// the fake blocked status, but it would be significantly more work in
// Chromium, and since it's not called anyway, don't bother.
@@ -284,7 +283,7 @@ class BlockingWriter : public QuicPacketWriterWrapper {
class QuicDispatcherWriteBlockedListTest : public QuicDispatcherTest {
public:
- virtual void SetUp() {
+ void SetUp() override {
writer_ = new BlockingWriter;
QuicDispatcherPeer::SetPacketWriterFactory(&dispatcher_,
new TestWriterFactory());
@@ -305,7 +304,7 @@ class QuicDispatcherWriteBlockedListTest : public QuicDispatcherTest {
blocked_list_ = QuicDispatcherPeer::GetWriteBlockedList(&dispatcher_);
}
- virtual void TearDown() {
+ void TearDown() override {
EXPECT_CALL(*connection1(), SendConnectionClose(QUIC_PEER_GOING_AWAY));
EXPECT_CALL(*connection2(), SendConnectionClose(QUIC_PEER_GOING_AWAY));
dispatcher_.Shutdown();
diff --git a/net/tools/quic/quic_epoll_clock.h b/net/tools/quic/quic_epoll_clock.h
index 4eebefb..c5a1390 100644
--- a/net/tools/quic/quic_epoll_clock.h
+++ b/net/tools/quic/quic_epoll_clock.h
@@ -21,14 +21,14 @@ namespace tools {
class QuicEpollClock : public QuicClock {
public:
explicit QuicEpollClock(EpollServer* epoll_server);
- virtual ~QuicEpollClock();
+ ~QuicEpollClock() override;
// Returns the approximate current time as a QuicTime object.
- virtual QuicTime ApproximateNow() const override;
+ QuicTime ApproximateNow() const override;
// Returns the current time as a QuicTime object.
// Note: this use significant resources please use only if needed.
- virtual QuicTime Now() const override;
+ QuicTime Now() const override;
protected:
EpollServer* epoll_server_;
diff --git a/net/tools/quic/quic_epoll_connection_helper.cc b/net/tools/quic/quic_epoll_connection_helper.cc
index a8321f8..b763d82 100644
--- a/net/tools/quic/quic_epoll_connection_helper.cc
+++ b/net/tools/quic/quic_epoll_connection_helper.cc
@@ -28,14 +28,14 @@ class QuicEpollAlarm : public QuicAlarm {
epoll_alarm_impl_(this) {}
protected:
- virtual void SetImpl() override {
+ void SetImpl() override {
DCHECK(deadline().IsInitialized());
epoll_server_->RegisterAlarm(
deadline().Subtract(QuicTime::Zero()).ToMicroseconds(),
&epoll_alarm_impl_);
}
- virtual void CancelImpl() override {
+ void CancelImpl() override {
DCHECK(!deadline().IsInitialized());
epoll_alarm_impl_.UnregisterIfRegistered();
}
@@ -45,7 +45,7 @@ class QuicEpollAlarm : public QuicAlarm {
public:
explicit EpollAlarmImpl(QuicEpollAlarm* alarm) : alarm_(alarm) {}
- virtual int64 OnAlarm() override {
+ int64 OnAlarm() override {
EpollAlarm::OnAlarm();
alarm_->Fire();
// Fire will take care of registering the alarm, if needed.
diff --git a/net/tools/quic/quic_epoll_connection_helper.h b/net/tools/quic/quic_epoll_connection_helper.h
index 9ca2cf8..66a27bb 100644
--- a/net/tools/quic/quic_epoll_connection_helper.h
+++ b/net/tools/quic/quic_epoll_connection_helper.h
@@ -33,12 +33,12 @@ class TimeoutAlarm;
class QuicEpollConnectionHelper : public QuicConnectionHelperInterface {
public:
explicit QuicEpollConnectionHelper(EpollServer* eps);
- virtual ~QuicEpollConnectionHelper();
+ ~QuicEpollConnectionHelper() override;
// QuicEpollConnectionHelperInterface
- virtual const QuicClock* GetClock() const override;
- virtual QuicRandom* GetRandomGenerator() override;
- virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
+ const QuicClock* GetClock() const override;
+ QuicRandom* GetRandomGenerator() override;
+ QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
EpollServer* epoll_server() { return epoll_server_; }
diff --git a/net/tools/quic/quic_epoll_connection_helper_test.cc b/net/tools/quic/quic_epoll_connection_helper_test.cc
index 7234ecf..0b31cdf 100644
--- a/net/tools/quic/quic_epoll_connection_helper_test.cc
+++ b/net/tools/quic/quic_epoll_connection_helper_test.cc
@@ -19,7 +19,7 @@ class TestDelegate : public QuicAlarm::Delegate {
public:
TestDelegate() : fired_(false) {}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
fired_ = true;
return QuicTime::Zero();
}
diff --git a/net/tools/quic/quic_in_memory_cache.cc b/net/tools/quic/quic_in_memory_cache.cc
index c90142c..cb96335 100644
--- a/net/tools/quic/quic_in_memory_cache.cc
+++ b/net/tools/quic/quic_in_memory_cache.cc
@@ -29,24 +29,14 @@ namespace {
class CachingBalsaVisitor : public NoOpBalsaVisitor {
public:
CachingBalsaVisitor() : done_framing_(false) {}
- virtual void ProcessBodyData(const char* input, size_t size) override {
+ void ProcessBodyData(const char* input, size_t size) override {
AppendToBody(input, size);
}
- virtual void MessageDone() override {
- done_framing_ = true;
- }
- virtual void HandleHeaderError(BalsaFrame* framer) override {
- UnhandledError();
- }
- virtual void HandleHeaderWarning(BalsaFrame* framer) override {
- UnhandledError();
- }
- virtual void HandleChunkingError(BalsaFrame* framer) override {
- UnhandledError();
- }
- virtual void HandleBodyError(BalsaFrame* framer) override {
- UnhandledError();
- }
+ void MessageDone() override { done_framing_ = true; }
+ void HandleHeaderError(BalsaFrame* framer) override { UnhandledError(); }
+ void HandleHeaderWarning(BalsaFrame* framer) override { UnhandledError(); }
+ void HandleChunkingError(BalsaFrame* framer) override { UnhandledError(); }
+ void HandleBodyError(BalsaFrame* framer) override { UnhandledError(); }
void UnhandledError() {
LOG(DFATAL) << "Unhandled error framing HTTP.";
}
diff --git a/net/tools/quic/quic_in_memory_cache_test.cc b/net/tools/quic/quic_in_memory_cache_test.cc
index 98a2b80..a94285c 100644
--- a/net/tools/quic/quic_in_memory_cache_test.cc
+++ b/net/tools/quic/quic_in_memory_cache_test.cc
@@ -39,9 +39,7 @@ class QuicInMemoryCacheTest : public ::testing::Test {
headers->ReplaceOrAppendHeader("host", host);
}
- virtual void SetUp() override {
- QuicInMemoryCachePeer::ResetForTests();
- }
+ void SetUp() override { QuicInMemoryCachePeer::ResetForTests(); }
// This method was copied from end_to_end_test.cc in this directory.
void AddToCache(const StringPiece& method,
diff --git a/net/tools/quic/quic_packet_writer_wrapper.h b/net/tools/quic/quic_packet_writer_wrapper.h
index a4db367..a8b819c 100644
--- a/net/tools/quic/quic_packet_writer_wrapper.h
+++ b/net/tools/quic/quic_packet_writer_wrapper.h
@@ -19,18 +19,17 @@ class QuicPacketWriterWrapper : public net::QuicPacketWriter {
public:
QuicPacketWriterWrapper();
explicit QuicPacketWriterWrapper(QuicPacketWriter* writer);
- virtual ~QuicPacketWriterWrapper();
+ ~QuicPacketWriterWrapper() override;
// Default implementation of the QuicPacketWriter interface. Passes everything
// to |writer_|.
- virtual WriteResult WritePacket(
- const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override;
- virtual bool IsWriteBlockedDataBuffered() const override;
- virtual bool IsWriteBlocked() const override;
- virtual void SetWritable() override;
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
+ bool IsWriteBlockedDataBuffered() const override;
+ bool IsWriteBlocked() const override;
+ void SetWritable() override;
// Takes ownership of |writer|.
void set_writer(QuicPacketWriter* writer);
diff --git a/net/tools/quic/quic_per_connection_packet_writer.h b/net/tools/quic/quic_per_connection_packet_writer.h
index 390e43d..51de178 100644
--- a/net/tools/quic/quic_per_connection_packet_writer.h
+++ b/net/tools/quic/quic_per_connection_packet_writer.h
@@ -19,20 +19,20 @@ class QuicPerConnectionPacketWriter : public QuicPacketWriter {
// Does not take ownership of |shared_writer| or |connection|.
QuicPerConnectionPacketWriter(QuicPacketWriter* shared_writer,
QuicConnection* connection);
- virtual ~QuicPerConnectionPacketWriter();
+ ~QuicPerConnectionPacketWriter() override;
QuicPacketWriter* shared_writer() const { return shared_writer_; }
QuicConnection* connection() const { return connection_; }
// Default implementation of the QuicPacketWriter interface: Passes everything
// to |shared_writer_|.
- virtual WriteResult WritePacket(const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override;
- virtual bool IsWriteBlockedDataBuffered() const override;
- virtual bool IsWriteBlocked() const override;
- virtual void SetWritable() override;
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
+ bool IsWriteBlockedDataBuffered() const override;
+ bool IsWriteBlocked() const override;
+ void SetWritable() override;
private:
QuicPacketWriter* shared_writer_; // Not owned.
diff --git a/net/tools/quic/quic_server.h b/net/tools/quic/quic_server.h
index a027a49..980f9ba 100644
--- a/net/tools/quic/quic_server.h
+++ b/net/tools/quic/quic_server.h
@@ -33,7 +33,7 @@ class QuicServer : public EpollCallbackInterface {
QuicServer(const QuicConfig& config,
const QuicVersionVector& supported_versions);
- virtual ~QuicServer();
+ ~QuicServer() override;
// Start listening on the specified address.
bool Listen(const IPEndPoint& address);
@@ -45,12 +45,10 @@ class QuicServer : public EpollCallbackInterface {
void Shutdown();
// From EpollCallbackInterface
- virtual void OnRegistration(EpollServer* eps,
- int fd,
- int event_mask) override {}
- virtual void OnModification(int fd, int event_mask) override {}
- virtual void OnEvent(int fd, EpollEvent* event) override;
- virtual void OnUnregistration(int fd, bool replaced) override {}
+ void OnRegistration(EpollServer* eps, int fd, int event_mask) override {}
+ void OnModification(int fd, int event_mask) override {}
+ void OnEvent(int fd, EpollEvent* event) override;
+ void OnUnregistration(int fd, bool replaced) override {}
// Reads a packet from the given fd, and then passes it off to
// the QuicDispatcher. Returns true if a packet is read, false
@@ -62,7 +60,7 @@ class QuicServer : public EpollCallbackInterface {
ProcessPacketInterface* processor,
uint32* packets_dropped);
- virtual void OnShutdown(EpollServer* eps, int fd) override {}
+ void OnShutdown(EpollServer* eps, int fd) override {}
void SetStrikeRegisterNoStartupPeriod() {
crypto_config_.set_strike_register_no_startup_period();
diff --git a/net/tools/quic/quic_server_session.h b/net/tools/quic/quic_server_session.h
index eb0aab6..acec14b 100644
--- a/net/tools/quic/quic_server_session.h
+++ b/net/tools/quic/quic_server_session.h
@@ -50,14 +50,14 @@ class QuicServerSession : public QuicSession {
QuicServerSessionVisitor* visitor);
// Override the base class to notify the owner of the connection close.
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
- virtual void OnWriteBlocked() override;
+ void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
+ void OnWriteBlocked() override;
// Sends a server config update to the client, containing new bandwidth
// estimate.
- virtual void OnCongestionWindowChange(QuicTime now) override;
+ void OnCongestionWindowChange(QuicTime now) override;
- virtual ~QuicServerSession();
+ ~QuicServerSession() override;
virtual void InitializeSession(const QuicCryptoServerConfig& crypto_config);
@@ -66,7 +66,7 @@ class QuicServerSession : public QuicSession {
}
// Override base class to process FEC config received from client.
- virtual void OnConfigNegotiated() override;
+ void OnConfigNegotiated() override;
void set_serving_region(string serving_region) {
serving_region_ = serving_region;
@@ -74,9 +74,9 @@ class QuicServerSession : public QuicSession {
protected:
// QuicSession methods:
- virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
- virtual QuicDataStream* CreateOutgoingDataStream() override;
- virtual QuicCryptoServerStream* GetCryptoStream() override;
+ QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
+ QuicDataStream* CreateOutgoingDataStream() override;
+ QuicCryptoServerStream* GetCryptoStream() override;
// If we should create an incoming stream, returns true. Otherwise
// does error handling, including communicating the error to the client and
diff --git a/net/tools/quic/quic_spdy_client_stream.h b/net/tools/quic/quic_spdy_client_stream.h
index 8274164..9b5573c 100644
--- a/net/tools/quic/quic_spdy_client_stream.h
+++ b/net/tools/quic/quic_spdy_client_stream.h
@@ -27,21 +27,21 @@ class QuicClientSession;
class QuicSpdyClientStream : public QuicDataStream {
public:
QuicSpdyClientStream(QuicStreamId id, QuicClientSession* session);
- virtual ~QuicSpdyClientStream();
+ ~QuicSpdyClientStream() override;
// Override the base class to close the write side as soon as we get a
// response.
// SPDY/HTTP does not support bidirectional streaming.
- virtual void OnStreamFrame(const QuicStreamFrame& frame) override;
+ void OnStreamFrame(const QuicStreamFrame& frame) override;
// Override the base class to store the size of the headers.
- virtual void OnStreamHeadersComplete(bool fin, size_t frame_len) override;
+ void OnStreamHeadersComplete(bool fin, size_t frame_len) override;
// ReliableQuicStream implementation called by the session when there's
// data for us.
- virtual uint32 ProcessData(const char* data, uint32 data_len) override;
+ uint32 ProcessData(const char* data, uint32 data_len) override;
- virtual void OnFinRead() override;
+ void OnFinRead() override;
// Serializes the headers and body, sends it to the server, and
// returns the number of bytes sent.
diff --git a/net/tools/quic/quic_spdy_server_stream.h b/net/tools/quic/quic_spdy_server_stream.h
index 4c2cb41..feb809f 100644
--- a/net/tools/quic/quic_spdy_server_stream.h
+++ b/net/tools/quic/quic_spdy_server_stream.h
@@ -28,12 +28,12 @@ class QuicSpdyServerStreamPeer;
class QuicSpdyServerStream : public QuicDataStream {
public:
QuicSpdyServerStream(QuicStreamId id, QuicSession* session);
- virtual ~QuicSpdyServerStream();
+ ~QuicSpdyServerStream() override;
// ReliableQuicStream implementation called by the session when there's
// data for us.
- virtual uint32 ProcessData(const char* data, uint32 data_len) override;
- virtual void OnFinRead() override;
+ uint32 ProcessData(const char* data, uint32 data_len) override;
+ void OnFinRead() override;
void ParseRequestHeaders();
diff --git a/net/tools/quic/quic_time_wait_list_manager.cc b/net/tools/quic/quic_time_wait_list_manager.cc
index f99bf3f..eb32282 100644
--- a/net/tools/quic/quic_time_wait_list_manager.cc
+++ b/net/tools/quic/quic_time_wait_list_manager.cc
@@ -43,7 +43,7 @@ class ConnectionIdCleanUpAlarm : public EpollAlarm {
: time_wait_list_manager_(time_wait_list_manager) {
}
- virtual int64 OnAlarm() override {
+ int64 OnAlarm() override {
EpollAlarm::OnAlarm();
time_wait_list_manager_->CleanUpOldConnectionIds();
// Let the time wait manager register the alarm at appropriate time.
diff --git a/net/tools/quic/quic_time_wait_list_manager.h b/net/tools/quic/quic_time_wait_list_manager.h
index d9a5f92..cf049ed1 100644
--- a/net/tools/quic/quic_time_wait_list_manager.h
+++ b/net/tools/quic/quic_time_wait_list_manager.h
@@ -52,7 +52,7 @@ class QuicTimeWaitListManager : public QuicBlockedWriterInterface {
QuicServerSessionVisitor* visitor,
EpollServer* epoll_server,
const QuicVersionVector& supported_versions);
- virtual ~QuicTimeWaitListManager();
+ ~QuicTimeWaitListManager() override;
// Adds the given connection_id to time wait state for kTimeWaitPeriod.
// Henceforth, any packet bearing this connection_id should not be processed
@@ -83,7 +83,7 @@ class QuicTimeWaitListManager : public QuicBlockedWriterInterface {
// Called by the dispatcher when the underlying socket becomes writable again,
// since we might need to send pending public reset packets which we didn't
// send because the underlying socket was write blocked.
- virtual void OnCanWrite() override;
+ void OnCanWrite() override;
// Used to delete connection_id entries that have outlived their time wait
// period.
diff --git a/net/tools/quic/quic_time_wait_list_manager_test.cc b/net/tools/quic/quic_time_wait_list_manager_test.cc
index 335b22c..05c3954 100644
--- a/net/tools/quic/quic_time_wait_list_manager_test.cc
+++ b/net/tools/quic/quic_time_wait_list_manager_test.cc
@@ -45,10 +45,9 @@ namespace test {
class FramerVisitorCapturingPublicReset : public NoOpFramerVisitor {
public:
FramerVisitorCapturingPublicReset() {}
- virtual ~FramerVisitorCapturingPublicReset() override {}
+ ~FramerVisitorCapturingPublicReset() override {}
- virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& public_reset) override {
+ void OnPublicResetPacket(const QuicPublicResetPacket& public_reset) override {
public_reset_packet_ = public_reset;
}
diff --git a/net/tools/quic/test_tools/mock_epoll_server.h b/net/tools/quic/test_tools/mock_epoll_server.h
index b3b312e..742a957 100644
--- a/net/tools/quic/test_tools/mock_epoll_server.h
+++ b/net/tools/quic/test_tools/mock_epoll_server.h
@@ -19,10 +19,10 @@ namespace test {
class FakeTimeEpollServer : public EpollServer {
public:
FakeTimeEpollServer();
- virtual ~FakeTimeEpollServer();
+ ~FakeTimeEpollServer() override;
// Replaces the EpollServer NowInUsec.
- virtual int64 NowInUsec() const override;
+ int64 NowInUsec() const override;
void set_now_in_usec(int64 nius) { now_in_usec_ = nius; }
@@ -52,7 +52,7 @@ class MockEpollServer : public FakeTimeEpollServer {
typedef base::hash_multimap<int64, struct epoll_event> EventQueue;
MockEpollServer();
- virtual ~MockEpollServer();
+ ~MockEpollServer() override;
// time_in_usec is the time at which the event specified
// by 'ee' will be delivered. Note that it -is- possible
@@ -85,16 +85,16 @@ class MockEpollServer : public FakeTimeEpollServer {
protected: // functions
// These functions do nothing here, as we're not actually
// using the epoll_* syscalls.
- virtual void DelFD(int fd) const override {}
- virtual void AddFD(int fd, int event_mask) const override {}
- virtual void ModFD(int fd, int event_mask) const override {}
+ void DelFD(int fd) const override {}
+ void AddFD(int fd, int event_mask) const override {}
+ void ModFD(int fd, int event_mask) const override {}
// Replaces the epoll_server's epoll_wait_impl.
- virtual int epoll_wait_impl(int epfd,
- struct epoll_event* events,
- int max_events,
- int timeout_in_ms) override;
- virtual void SetNonblocking (int fd) override {}
+ int epoll_wait_impl(int epfd,
+ struct epoll_event* events,
+ int max_events,
+ int timeout_in_ms) override;
+ void SetNonblocking(int fd) override {}
private: // members
EventQueue event_queue_;
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.cc b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
index 2571868..9e01fd4b 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.cc
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
@@ -21,7 +21,7 @@ class WriteUnblockedAlarm : public QuicAlarm::Delegate {
explicit WriteUnblockedAlarm(PacketDroppingTestWriter* writer)
: writer_(writer) {}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
DVLOG(1) << "Unblocking socket.";
writer_->OnCanWrite();
return QuicTime::Zero();
@@ -37,9 +37,7 @@ class DelayAlarm : public QuicAlarm::Delegate {
public:
explicit DelayAlarm(PacketDroppingTestWriter* writer) : writer_(writer) {}
- virtual QuicTime OnAlarm() override {
- return writer_->ReleaseOldPackets();
- }
+ QuicTime OnAlarm() override { return writer_->ReleaseOldPackets(); }
private:
PacketDroppingTestWriter* writer_;
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.h b/net/tools/quic/test_tools/packet_dropping_test_writer.h
index 29a21a8..842d70e 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.h
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.h
@@ -36,7 +36,7 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
PacketDroppingTestWriter();
- virtual ~PacketDroppingTestWriter();
+ ~PacketDroppingTestWriter() override;
// Must be called before blocking, reordering or delaying (loss is OK). May be
// called after connecting if the helper is not available before.
@@ -45,15 +45,14 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
void Initialize(QuicEpollConnectionHelper* helper, Delegate* on_can_write);
// QuicPacketWriter methods:
- virtual WriteResult WritePacket(
- const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override;
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
- virtual bool IsWriteBlocked() const override;
+ bool IsWriteBlocked() const override;
- virtual void SetWritable() override;
+ void SetWritable() override;
// Writes out any packet which should have been sent by now
// to the contained writer and returns the time
diff --git a/net/tools/quic/test_tools/quic_test_client.cc b/net/tools/quic/test_tools/quic_test_client.cc
index d53958d..e1a2740 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -41,15 +41,14 @@ namespace {
class RecordingProofVerifier : public ProofVerifier {
public:
// ProofVerifier interface.
- virtual QuicAsyncStatus VerifyProof(
- const string& hostname,
- const string& server_config,
- const vector<string>& certs,
- const string& signature,
- const ProofVerifyContext* context,
- string* error_details,
- scoped_ptr<ProofVerifyDetails>* details,
- ProofVerifierCallback* callback) override {
+ QuicAsyncStatus VerifyProof(const string& hostname,
+ const string& server_config,
+ const vector<string>& certs,
+ const string& signature,
+ const ProofVerifyContext* context,
+ string* error_details,
+ scoped_ptr<ProofVerifyDetails>* details,
+ ProofVerifierCallback* callback) override {
common_name_.clear();
if (certs.empty()) {
return QUIC_FAILURE;
diff --git a/net/tools/quic/test_tools/quic_test_client.h b/net/tools/quic/test_tools/quic_test_client.h
index c9fd22e..c5b7a3b 100644
--- a/net/tools/quic/test_tools/quic_test_client.h
+++ b/net/tools/quic/test_tools/quic_test_client.h
@@ -45,9 +45,9 @@ class MockableQuicClient : public QuicClient {
const QuicVersionVector& supported_versions,
EpollServer* epoll_server);
- virtual ~MockableQuicClient() override;
- virtual QuicPacketWriter* CreateQuicPacketWriter() override;
- virtual QuicConnectionId GenerateConnectionId() override;
+ ~MockableQuicClient() override;
+ QuicPacketWriter* CreateQuicPacketWriter() override;
+ QuicConnectionId GenerateConnectionId() override;
void UseWriter(QuicPacketWriterWrapper* writer);
void UseConnectionId(QuicConnectionId connection_id);
@@ -75,7 +75,7 @@ class QuicTestClient : public SimpleClient,
const QuicConfig& config,
const QuicVersionVector& supported_versions);
- virtual ~QuicTestClient();
+ ~QuicTestClient() override;
// ExpectCertificates controls whether the server is expected to provide
// certificates. The certificates, if any, are not verified, but the common
@@ -91,45 +91,43 @@ class QuicTestClient : public SimpleClient,
// From SimpleClient
// Clears any outstanding state and sends a simple GET of 'uri' to the
// server. Returns 0 if the request failed and no bytes were written.
- virtual ssize_t SendRequest(const string& uri) override;
- virtual ssize_t SendMessage(const HTTPMessage& message) override;
- virtual string SendCustomSynchronousRequest(
- const HTTPMessage& message) override;
- virtual string SendSynchronousRequest(const string& uri) override;
- virtual void Connect() override;
- virtual void ResetConnection() override;
- virtual void Disconnect() override;
- virtual IPEndPoint LocalSocketAddress() const override;
- virtual void ClearPerRequestState() override;
- virtual void WaitForResponseForMs(int timeout_ms) override;
- virtual void WaitForInitialResponseForMs(int timeout_ms) override;
- virtual ssize_t Send(const void *buffer, size_t size) override;
- virtual bool response_complete() const override;
- virtual bool response_headers_complete() const override;
- virtual const BalsaHeaders* response_headers() const override;
- virtual int64 response_size() const override;
- virtual int response_header_size() const override;
- virtual int64 response_body_size() const override;
- virtual size_t bytes_read() const override;
- virtual size_t bytes_written() const override;
- virtual bool buffer_body() const override;
- virtual void set_buffer_body(bool buffer_body) override;
- virtual bool ServerInLameDuckMode() const override;
- virtual const string& response_body() override;
- virtual bool connected() const override;
+ ssize_t SendRequest(const string& uri) override;
+ ssize_t SendMessage(const HTTPMessage& message) override;
+ string SendCustomSynchronousRequest(const HTTPMessage& message) override;
+ string SendSynchronousRequest(const string& uri) override;
+ void Connect() override;
+ void ResetConnection() override;
+ void Disconnect() override;
+ IPEndPoint LocalSocketAddress() const override;
+ void ClearPerRequestState() override;
+ void WaitForResponseForMs(int timeout_ms) override;
+ void WaitForInitialResponseForMs(int timeout_ms) override;
+ ssize_t Send(const void* buffer, size_t size) override;
+ bool response_complete() const override;
+ bool response_headers_complete() const override;
+ const BalsaHeaders* response_headers() const override;
+ int64 response_size() const override;
+ int response_header_size() const override;
+ int64 response_body_size() const override;
+ size_t bytes_read() const override;
+ size_t bytes_written() const override;
+ bool buffer_body() const override;
+ void set_buffer_body(bool buffer_body) override;
+ bool ServerInLameDuckMode() const override;
+ const string& response_body() override;
+ bool connected() const override;
// These functions are all unimplemented functions from SimpleClient, and log
// DFATAL if called by users of SimpleClient.
- virtual ssize_t SendAndWaitForResponse(const void *buffer,
- size_t size) override;
- virtual void Bind(IPEndPoint* local_address) override;
- virtual string SerializeMessage(const HTTPMessage& message) override;
- virtual IPAddressNumber bind_to_address() const override;
- virtual void set_bind_to_address(IPAddressNumber address) override;
- virtual const IPEndPoint& address() const override;
- virtual size_t requests_sent() const override;
+ ssize_t SendAndWaitForResponse(const void* buffer, size_t size) override;
+ void Bind(IPEndPoint* local_address) override;
+ string SerializeMessage(const HTTPMessage& message) override;
+ IPAddressNumber bind_to_address() const override;
+ void set_bind_to_address(IPAddressNumber address) override;
+ const IPEndPoint& address() const override;
+ size_t requests_sent() const override;
// From QuicDataStream::Visitor
- virtual void OnClose(QuicDataStream* stream) override;
+ void OnClose(QuicDataStream* stream) override;
// Configures client_ to take ownership of and use the writer.
// Must be called before initial connect.
diff --git a/net/tools/quic/test_tools/quic_test_utils.cc b/net/tools/quic/test_tools/quic_test_utils.cc
index 781b3c3..2477483 100644
--- a/net/tools/quic/test_tools/quic_test_utils.cc
+++ b/net/tools/quic/test_tools/quic_test_utils.cc
@@ -23,10 +23,9 @@ class NiceMockPacketWriterFactory
: public QuicConnection::PacketWriterFactory {
public:
NiceMockPacketWriterFactory() {}
- virtual ~NiceMockPacketWriterFactory() {}
+ ~NiceMockPacketWriterFactory() override {}
- virtual QuicPacketWriter* Create(
- QuicConnection* /*connection*/) const override {
+ QuicPacketWriter* Create(QuicConnection* /*connection*/) const override {
return new testing::NiceMock<MockPacketWriter>();
}
diff --git a/net/tools/quic/test_tools/quic_test_utils.h b/net/tools/quic/test_tools/quic_test_utils.h
index dc70e69..cbd7fbe 100644
--- a/net/tools/quic/test_tools/quic_test_utils.h
+++ b/net/tools/quic/test_tools/quic_test_utils.h
@@ -166,10 +166,10 @@ class MockAckNotifierDelegate : public QuicAckNotifier::DelegateInterface {
class TestWriterFactory : public QuicDispatcher::PacketWriterFactory {
public:
TestWriterFactory();
- virtual ~TestWriterFactory();
+ ~TestWriterFactory() override;
- virtual QuicPacketWriter* Create(QuicPacketWriter* writer,
- QuicConnection* connection) override;
+ QuicPacketWriter* Create(QuicPacketWriter* writer,
+ QuicConnection* connection) override;
// Calls OnPacketSent on the last QuicConnection to write through one of the
// packet writers created by this factory.
@@ -181,13 +181,12 @@ class TestWriterFactory : public QuicDispatcher::PacketWriterFactory {
PerConnectionPacketWriter(TestWriterFactory* factory,
QuicPacketWriter* writer,
QuicConnection* connection);
- virtual ~PerConnectionPacketWriter();
+ ~PerConnectionPacketWriter() override;
- virtual WriteResult WritePacket(
- const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override;
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
private:
TestWriterFactory* factory_;
diff --git a/net/tools/quic/test_tools/server_thread.h b/net/tools/quic/test_tools/server_thread.h
index cb92b01..774ff67 100644
--- a/net/tools/quic/test_tools/server_thread.h
+++ b/net/tools/quic/test_tools/server_thread.h
@@ -21,14 +21,14 @@ class ServerThread : public base::SimpleThread {
IPEndPoint address,
bool strike_register_no_startup_period);
- virtual ~ServerThread();
+ ~ServerThread() override;
// Prepares the server, but does not start accepting connections. Useful for
// injecting mocks.
void Initialize();
// Runs the event loop. Will initialize if necessary.
- virtual void Run() override;
+ void Run() override;
// Waits for the handshake to be confirmed for the first session created.
void WaitForCryptoHandshakeConfirmed();