Skip to content

Commit

Permalink
Standardize usage of virtual/override/final in net/
Browse files Browse the repository at this point in the history
This patch was automatically generated by applying clang fixit hints
generated by the plugin to the source tree.

BUG=417463
TBR=rsleevi@chromium.org

Review URL: https://codereview.chromium.org/667923003

Cr-Commit-Position: refs/heads/master@{#300466}
  • Loading branch information
zetafunction authored and Commit bot committed Oct 21, 2014
1 parent e59c1bb commit b03027d
Show file tree
Hide file tree
Showing 396 changed files with 5,092 additions and 5,581 deletions.
6 changes: 2 additions & 4 deletions net/base/backoff_entry_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ class TestBackoffEntry : public BackoffEntry {
SetCustomReleaseTime(TimeTicks());
}

virtual ~TestBackoffEntry() {}
~TestBackoffEntry() override {}

virtual TimeTicks ImplGetTimeNow() const override {
return now_;
}
TimeTicks ImplGetTimeNow() const override { return now_; }

void set_now(const TimeTicks& now) {
now_ = now;
Expand Down
6 changes: 3 additions & 3 deletions net/base/capturing_net_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CapturingNetLog : public NetLog {
typedef std::vector<CapturedEntry> CapturedEntryList;

CapturingNetLog();
virtual ~CapturingNetLog();
~CapturingNetLog() override;

void SetLogLevel(LogLevel log_level);

Expand All @@ -89,7 +89,7 @@ class CapturingNetLog : public NetLog {
class Observer : public NetLog::ThreadSafeObserver {
public:
Observer();
virtual ~Observer();
~Observer() override;

// Returns the list of all entries in the log.
void GetEntries(CapturedEntryList* entry_list) const;
Expand All @@ -105,7 +105,7 @@ class CapturingNetLog : public NetLog {

private:
// ThreadSafeObserver implementation:
virtual void OnAddEntry(const Entry& entry) override;
void OnAddEntry(const Entry& entry) override;

// Needs to be "mutable" so can use it in GetEntries().
mutable base::Lock lock_;
Expand Down
8 changes: 4 additions & 4 deletions net/base/chunked_upload_data_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class NET_EXPORT ChunkedUploadDataStream : public UploadDataStream {
public:
ChunkedUploadDataStream(int64 identifier);

virtual ~ChunkedUploadDataStream();
~ChunkedUploadDataStream() override;

// Adds data to the stream. |is_done| should be true if this is the last
// data to be appended. |data_len| must not be 0 unless |is_done| is true.
Expand All @@ -35,9 +35,9 @@ class NET_EXPORT ChunkedUploadDataStream : public UploadDataStream {

private:
// UploadDataStream implementation.
virtual int InitInternal() override;
virtual int ReadInternal(IOBuffer* buf, int buf_len) override;
virtual void ResetInternal() override;
int InitInternal() override;
int ReadInternal(IOBuffer* buf, int buf_len) override;
void ResetInternal() override;

int ReadChunk(IOBuffer* buf, int buf_len);

Expand Down
5 changes: 2 additions & 3 deletions net/base/directory_lister_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ class ListerDelegate : public DirectoryLister::DirectoryListerDelegate {
quit_loop_after_each_file_(quit_loop_after_each_file) {
}

virtual void OnListFile(
const DirectoryLister::DirectoryListerData& data) override {
void OnListFile(const DirectoryLister::DirectoryListerData& data) override {
file_list_.push_back(data.info);
paths_.push_back(data.path);
if (quit_loop_after_each_file_)
base::MessageLoop::current()->Quit();
}

virtual void OnListDone(int error) override {
void OnListDone(int error) override {
error_ = error;
base::MessageLoop::current()->Quit();
if (recursive_)
Expand Down
13 changes: 6 additions & 7 deletions net/base/elements_upload_data_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NET_EXPORT ElementsUploadDataStream : public UploadDataStream {
ElementsUploadDataStream(ScopedVector<UploadElementReader> element_readers,
int64 identifier);

virtual ~ElementsUploadDataStream();
~ElementsUploadDataStream() override;

// Creates an ElementsUploadDataStream with a single reader. Returns a
// scoped_ptr<UploadDataStream> for ease of use.
Expand All @@ -36,12 +36,11 @@ class NET_EXPORT ElementsUploadDataStream : public UploadDataStream {

private:
// UploadDataStream implementation.
virtual bool IsInMemory() const override;
virtual const ScopedVector<UploadElementReader>*
GetElementReaders() const override;
virtual int InitInternal() override;
virtual int ReadInternal(IOBuffer* buf, int buf_len) override;
virtual void ResetInternal() override;
bool IsInMemory() const override;
const ScopedVector<UploadElementReader>* GetElementReaders() const override;
int InitInternal() override;
int ReadInternal(IOBuffer* buf, int buf_len) override;
void ResetInternal() override;

// Runs Init() for all element readers.
// This method is used to implement InitInternal().
Expand Down
12 changes: 6 additions & 6 deletions net/base/io_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class NET_EXPORT IOBufferWithSize : public IOBuffer {
// constructor IOBuffer(char*) thus allowing subclass to use underlying
// memory it does not own.
IOBufferWithSize(char* data, int size);
virtual ~IOBufferWithSize();
~IOBufferWithSize() override;

int size_;
};
Expand All @@ -119,7 +119,7 @@ class NET_EXPORT StringIOBuffer : public IOBuffer {
int size() const { return static_cast<int>(string_data_.size()); }

private:
virtual ~StringIOBuffer();
~StringIOBuffer() override;

std::string string_data_;
};
Expand Down Expand Up @@ -162,7 +162,7 @@ class NET_EXPORT DrainableIOBuffer : public IOBuffer {
int size() const { return size_; }

private:
virtual ~DrainableIOBuffer();
~DrainableIOBuffer() override;

scoped_refptr<IOBuffer> base_;
int size_;
Expand Down Expand Up @@ -202,7 +202,7 @@ class NET_EXPORT GrowableIOBuffer : public IOBuffer {
char* StartOfBuffer();

private:
virtual ~GrowableIOBuffer();
~GrowableIOBuffer() override;

scoped_ptr<char, base::FreeDeleter> real_data_;
int capacity_;
Expand All @@ -222,7 +222,7 @@ class NET_EXPORT PickledIOBuffer : public IOBuffer {
void Done();

private:
virtual ~PickledIOBuffer();
~PickledIOBuffer() override;

Pickle pickle_;
};
Expand All @@ -237,7 +237,7 @@ class NET_EXPORT WrappedIOBuffer : public IOBuffer {
explicit WrappedIOBuffer(const char* data);

protected:
virtual ~WrappedIOBuffer();
~WrappedIOBuffer() override;
};

} // namespace net
Expand Down
21 changes: 11 additions & 10 deletions net/base/mock_file_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ class MockFileStream : public net::FileStream {
explicit MockFileStream(const scoped_refptr<base::TaskRunner>& task_runner);
MockFileStream(base::File file,
const scoped_refptr<base::TaskRunner>& task_runner);
virtual ~MockFileStream();
~MockFileStream() override;

// FileStream methods.
virtual int Seek(base::File::Whence whence, int64 offset,
const Int64CompletionCallback& callback) override;
virtual int Read(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
virtual int Flush(const CompletionCallback& callback) override;
int Seek(base::File::Whence whence,
int64 offset,
const Int64CompletionCallback& callback) override;
int Read(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
int Flush(const CompletionCallback& callback) override;

void set_forced_error_async(int error) {
forced_error_ = error;
Expand Down
4 changes: 2 additions & 2 deletions net/base/net_log_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class NET_EXPORT NetLogLogger : public NetLog::ThreadSafeObserver {
// starts. |file| must be non-NULL handle and be open for writing.
// |constants| is a legend for decoding constant values used in the log.
NetLogLogger(FILE* file, const base::Value& constants);
virtual ~NetLogLogger();
~NetLogLogger() override;

// Sets the log level to log at. Must be called before StartObserving.
void set_log_level(NetLog::LogLevel log_level);
Expand All @@ -41,7 +41,7 @@ class NET_EXPORT NetLogLogger : public NetLog::ThreadSafeObserver {
void StopObserving();

// net::NetLog::ThreadSafeObserver implementation:
virtual void OnAddEntry(const NetLog::Entry& entry) override;
void OnAddEntry(const NetLog::Entry& entry) override;

// Create a dictionary containing legend for net/ constants. Caller takes
// ownership of returned value.
Expand Down
22 changes: 9 additions & 13 deletions net/base/net_log_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,12 @@ class CountingObserver : public NetLog::ThreadSafeObserver {
public:
CountingObserver() : count_(0) {}

virtual ~CountingObserver() {
~CountingObserver() override {
if (net_log())
net_log()->RemoveThreadSafeObserver(this);
}

virtual void OnAddEntry(const NetLog::Entry& entry) override {
++count_;
}
void OnAddEntry(const NetLog::Entry& entry) override { ++count_; }

int count() const { return count_; }

Expand All @@ -94,12 +92,12 @@ class LoggingObserver : public NetLog::ThreadSafeObserver {
public:
LoggingObserver() {}

virtual ~LoggingObserver() {
~LoggingObserver() override {
if (net_log())
net_log()->RemoveThreadSafeObserver(this);
}

virtual void OnAddEntry(const NetLog::Entry& entry) override {
void OnAddEntry(const NetLog::Entry& entry) override {
base::Value* value = entry.ToValue();
base::DictionaryValue* dict = NULL;
ASSERT_TRUE(value->GetAsDictionary(&dict));
Expand Down Expand Up @@ -138,7 +136,7 @@ class NetLogTestThread : public base::SimpleThread {
net_log_ = net_log;
}

virtual void Run() override {
void Run() override {
start_event_->Wait();
RunTestThread();
}
Expand All @@ -162,10 +160,10 @@ class NetLogTestThread : public base::SimpleThread {
class AddEventsTestThread : public NetLogTestThread {
public:
AddEventsTestThread() {}
virtual ~AddEventsTestThread() {}
~AddEventsTestThread() override {}

private:
virtual void RunTestThread() override {
void RunTestThread() override {
for (int i = 0; i < kEvents; ++i)
AddEvent(net_log_);
}
Expand All @@ -178,12 +176,10 @@ class AddRemoveObserverTestThread : public NetLogTestThread {
public:
AddRemoveObserverTestThread() {}

virtual ~AddRemoveObserverTestThread() {
EXPECT_TRUE(!observer_.net_log());
}
~AddRemoveObserverTestThread() override { EXPECT_TRUE(!observer_.net_log()); }

private:
virtual void RunTestThread() override {
void RunTestThread() override {
for (int i = 0; i < kEvents; ++i) {
ASSERT_FALSE(observer_.net_log());

Expand Down
4 changes: 2 additions & 2 deletions net/base/net_util_icu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ class HostComponentTransform : public AppendComponentTransform {
}

private:
virtual base::string16 Execute(
base::string16 Execute(
const std::string& component_text,
base::OffsetAdjuster::Adjustments* adjustments) const override {
return IDNToUnicodeWithAdjustments(component_text, languages_,
Expand All @@ -508,7 +508,7 @@ class NonHostComponentTransform : public AppendComponentTransform {
}

private:
virtual base::string16 Execute(
base::string16 Execute(
const std::string& component_text,
base::OffsetAdjuster::Adjustments* adjustments) const override {
return (unescape_rules_ == UnescapeRule::NONE) ?
Expand Down
19 changes: 9 additions & 10 deletions net/base/network_change_notifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ NetworkChangeNotifierFactory* g_network_change_notifier_factory = NULL;

class MockNetworkChangeNotifier : public NetworkChangeNotifier {
public:
virtual ConnectionType GetCurrentConnectionType() const override {
ConnectionType GetCurrentConnectionType() const override {
return CONNECTION_UNKNOWN;
}
};
Expand Down Expand Up @@ -83,7 +83,7 @@ class HistogramWatcher
NetworkChangeNotifier::AddNetworkChangeObserver(this);
}

virtual ~HistogramWatcher() {
~HistogramWatcher() override {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(g_network_change_notifier);
NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
Expand All @@ -93,7 +93,7 @@ class HistogramWatcher
}

// NetworkChangeNotifier::IPAddressObserver implementation.
virtual void OnIPAddressChanged() override {
void OnIPAddressChanged() override {
DCHECK(thread_checker_.CalledOnValidThread());
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.IPAddressChange",
SinceLast(&last_ip_address_change_));
Expand All @@ -103,7 +103,7 @@ class HistogramWatcher
}

// NetworkChangeNotifier::ConnectionTypeObserver implementation.
virtual void OnConnectionTypeChanged(
void OnConnectionTypeChanged(
NetworkChangeNotifier::ConnectionType type) override {
DCHECK(thread_checker_.CalledOnValidThread());
base::TimeTicks now = base::TimeTicks::Now();
Expand Down Expand Up @@ -264,15 +264,14 @@ class HistogramWatcher
}

// NetworkChangeNotifier::DNSObserver implementation.
virtual void OnDNSChanged() override {
void OnDNSChanged() override {
DCHECK(thread_checker_.CalledOnValidThread());
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.DNSConfigChange",
SinceLast(&last_dns_change_));
}

// NetworkChangeNotifier::NetworkChangeObserver implementation.
virtual void OnNetworkChanged(
NetworkChangeNotifier::ConnectionType type) override {
void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) override {
DCHECK(thread_checker_.CalledOnValidThread());
if (type != NetworkChangeNotifier::CONNECTION_NONE) {
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.NetworkOnlineChange",
Expand Down Expand Up @@ -424,15 +423,15 @@ class NetworkChangeNotifier::NetworkChangeCalculator
AddIPAddressObserver(this);
}

virtual ~NetworkChangeCalculator() {
~NetworkChangeCalculator() override {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(g_network_change_notifier);
RemoveConnectionTypeObserver(this);
RemoveIPAddressObserver(this);
}

// NetworkChangeNotifier::IPAddressObserver implementation.
virtual void OnIPAddressChanged() override {
void OnIPAddressChanged() override {
DCHECK(thread_checker_.CalledOnValidThread());
base::TimeDelta delay = last_announced_connection_type_ == CONNECTION_NONE
? params_.ip_address_offline_delay_ : params_.ip_address_online_delay_;
Expand All @@ -441,7 +440,7 @@ class NetworkChangeNotifier::NetworkChangeCalculator
}

// NetworkChangeNotifier::ConnectionTypeObserver implementation.
virtual void OnConnectionTypeChanged(ConnectionType type) override {
void OnConnectionTypeChanged(ConnectionType type) override {
DCHECK(thread_checker_.CalledOnValidThread());
pending_connection_type_ = type;
base::TimeDelta delay = last_announced_connection_type_ == CONNECTION_NONE
Expand Down
10 changes: 3 additions & 7 deletions net/base/network_change_notifier_mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,14 @@ class NetworkChangeNotifierMac::DnsConfigServiceThread : public base::Thread {
public:
DnsConfigServiceThread() : base::Thread("DnsConfigService") {}

virtual ~DnsConfigServiceThread() {
Stop();
}
~DnsConfigServiceThread() override { Stop(); }

virtual void Init() override {
void Init() override {
service_ = DnsConfigService::CreateSystemService();
service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig));
}

virtual void CleanUp() override {
service_.reset();
}
void CleanUp() override { service_.reset(); }

private:
scoped_ptr<DnsConfigService> service_;
Expand Down
Loading

0 comments on commit b03027d

Please sign in to comment.