Update {virtual,override} to follow C++11 style in base.
The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override.
This patch was manually generated using a regex and a text editor.
BUG=417463
Review URL: https://codereview.chromium.org/1094903006
Cr-Commit-Position: refs/heads/master@{#326392}
diff --git a/base/files/file_path_watcher_stub.cc b/base/files/file_path_watcher_stub.cc
index d7ad2066..8138692e 100644
--- a/base/files/file_path_watcher_stub.cc
+++ b/base/files/file_path_watcher_stub.cc
@@ -13,18 +13,18 @@
class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
public:
- virtual bool Watch(const FilePath& path,
- bool recursive,
- const FilePathWatcher::Callback& callback) override {
+ bool Watch(const FilePath& path,
+ bool recursive,
+ const FilePathWatcher::Callback& callback) override {
return false;
}
- virtual void Cancel() override {}
+ void Cancel() override {}
- virtual void CancelOnMessageLoopThread() override {}
+ void CancelOnMessageLoopThread() override {}
protected:
- virtual ~FilePathWatcherImpl() {}
+ ~FilePathWatcherImpl() override {}
};
} // namespace
diff --git a/base/json/json_value_converter.h b/base/json/json_value_converter.h
index c4bfe61..f94d46e3 100644
--- a/base/json/json_value_converter.h
+++ b/base/json/json_value_converter.h
@@ -123,8 +123,7 @@
value_converter_(converter) {
}
- virtual bool ConvertField(
- const base::Value& value, StructType* dst) const override {
+ bool ConvertField(const base::Value& value, StructType* dst) const override {
return value_converter_->Convert(value, &(dst->*field_pointer_));
}
@@ -202,8 +201,7 @@
ValueFieldConverter(ConvertFunc convert_func)
: convert_func_(convert_func) {}
- virtual bool Convert(const base::Value& value,
- FieldType* field) const override {
+ bool Convert(const base::Value& value, FieldType* field) const override {
return convert_func_(&value, field);
}
@@ -221,8 +219,7 @@
CustomFieldConverter(ConvertFunc convert_func)
: convert_func_(convert_func) {}
- virtual bool Convert(const base::Value& value,
- FieldType* field) const override {
+ bool Convert(const base::Value& value, FieldType* field) const override {
std::string string_value;
return value.GetAsString(&string_value) &&
convert_func_(string_value, field);
@@ -239,8 +236,7 @@
public:
NestedValueConverter() {}
- virtual bool Convert(
- const base::Value& value, NestedType* field) const override {
+ bool Convert(const base::Value& value, NestedType* field) const override {
return converter_.Convert(value, field);
}
@@ -254,8 +250,8 @@
public:
RepeatedValueConverter() {}
- virtual bool Convert(
- const base::Value& value, ScopedVector<Element>* field) const override {
+ bool Convert(const base::Value& value,
+ ScopedVector<Element>* field) const override {
const base::ListValue* list = NULL;
if (!value.GetAsList(&list)) {
// The field is not a list.
@@ -290,8 +286,8 @@
public:
RepeatedMessageConverter() {}
- virtual bool Convert(const base::Value& value,
- ScopedVector<NestedType>* field) const override {
+ bool Convert(const base::Value& value,
+ ScopedVector<NestedType>* field) const override {
const base::ListValue* list = NULL;
if (!value.GetAsList(&list))
return false;
@@ -327,8 +323,8 @@
RepeatedCustomValueConverter(ConvertFunc convert_func)
: convert_func_(convert_func) {}
- virtual bool Convert(const base::Value& value,
- ScopedVector<NestedType>* field) const override {
+ bool Convert(const base::Value& value,
+ ScopedVector<NestedType>* field) const override {
const base::ListValue* list = NULL;
if (!value.GetAsList(&list))
return false;
diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc
index 636aa83..46b350b 100644
--- a/base/observer_list_unittest.cc
+++ b/base/observer_list_unittest.cc
@@ -71,7 +71,7 @@
adder(1) {
}
- virtual void Observe(int x) override {
+ void Observe(int x) override {
if (!added) {
added = true;
observer_list->AddObserver(&adder);
diff --git a/base/prefs/pref_member.h b/base/prefs/pref_member.h
index 078be95..9b140d1 100644
--- a/base/prefs/pref_member.h
+++ b/base/prefs/pref_member.h
@@ -264,9 +264,9 @@
}
protected:
- virtual ~Internal() {}
+ ~Internal() override {}
- virtual BASE_PREFS_EXPORT bool UpdateValueInternal(
+ BASE_PREFS_EXPORT bool UpdateValueInternal(
const base::Value& value) const override;
// We cache the value of the pref so we don't have to keep walking the pref
@@ -277,8 +277,8 @@
DISALLOW_COPY_AND_ASSIGN(Internal);
};
- virtual Internal* internal() const override { return internal_.get(); }
- virtual void CreateInternal() const override { internal_ = new Internal(); }
+ Internal* internal() const override { return internal_.get(); }
+ void CreateInternal() const override { internal_ = new Internal(); }
// This method is used to do the actual sync with pref of the specified type.
void BASE_PREFS_EXPORT UpdatePref(const ValueType& value);
diff --git a/base/test/gtest_xml_util.h b/base/test/gtest_xml_util.h
index f832cde..9ff2406 100644
--- a/base/test/gtest_xml_util.h
+++ b/base/test/gtest_xml_util.h
@@ -21,17 +21,17 @@
class XmlUnitTestResultPrinter : public testing::EmptyTestEventListener {
public:
XmlUnitTestResultPrinter();
- virtual ~XmlUnitTestResultPrinter();
+ ~XmlUnitTestResultPrinter() override;
// Must be called before adding as a listener. Returns true on success.
bool Initialize(const FilePath& output_file_path) WARN_UNUSED_RESULT;
private:
// testing::EmptyTestEventListener:
- virtual void OnTestCaseStart(const testing::TestCase& test_case) override;
- virtual void OnTestStart(const testing::TestInfo& test_info) override;
- virtual void OnTestEnd(const testing::TestInfo& test_info) override;
- virtual void OnTestCaseEnd(const testing::TestCase& test_case) override;
+ void OnTestCaseStart(const testing::TestCase& test_case) override;
+ void OnTestStart(const testing::TestInfo& test_info) override;
+ void OnTestEnd(const testing::TestInfo& test_info) override;
+ void OnTestCaseEnd(const testing::TestCase& test_case) override;
FILE* output_file_;
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index d40dd983..ee135e53 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -55,7 +55,7 @@
class MaybeTestDisabler : public testing::EmptyTestEventListener {
public:
- virtual void OnTestStart(const testing::TestInfo& test_info) override {
+ void OnTestStart(const testing::TestInfo& test_info) override {
ASSERT_FALSE(TestSuite::IsMarkedMaybe(test_info))
<< "Probably the OS #ifdefs don't include all of the necessary "
"platforms.\nPlease ensure that no tests have the MAYBE_ prefix "
@@ -69,11 +69,11 @@
: old_command_line_(base::CommandLine::NO_PROGRAM) {
}
- virtual void OnTestStart(const testing::TestInfo& test_info) override {
+ void OnTestStart(const testing::TestInfo& test_info) override {
old_command_line_ = *base::CommandLine::ForCurrentProcess();
}
- virtual void OnTestEnd(const testing::TestInfo& test_info) override {
+ void OnTestEnd(const testing::TestInfo& test_info) override {
*base::CommandLine::ForCurrentProcess() = old_command_line_;
}
diff --git a/base/threading/thread_perftest.cc b/base/threading/thread_perftest.cc
index b94f942..a08cc5bf 100644
--- a/base/threading/thread_perftest.cc
+++ b/base/threading/thread_perftest.cc
@@ -174,12 +174,12 @@
template <typename WaitableEventType>
class EventPerfTest : public ThreadPerfTest {
public:
- virtual void Init() override {
+ void Init() override {
for (size_t i = 0; i < threads_.size(); i++)
events_.push_back(new WaitableEventType(false, false));
}
- virtual void Reset() override { events_.clear(); }
+ void Reset() override { events_.clear(); }
void WaitAndSignalOnThread(size_t event) {
size_t next_event = (event + 1) % events_.size();
@@ -195,7 +195,7 @@
FinishMeasurement();
}
- virtual void PingPong(int hops) override {
+ void PingPong(int hops) override {
remaining_hops_ = hops;
for (size_t i = 0; i < threads_.size(); i++) {
threads_[i]->message_loop_proxy()->PostTask(
diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h
index 7c4d3ab..79ec4a8 100644
--- a/base/trace_event/trace_event.h
+++ b/base/trace_event/trace_event.h
@@ -144,11 +144,11 @@
// class MyData : public base::trace_event::ConvertableToTraceFormat {
// public:
// MyData() {}
-// virtual void AppendAsTraceFormat(std::string* out) const override {
+// void AppendAsTraceFormat(std::string* out) const override {
// out->append("{\"foo\":1}");
// }
// private:
-// virtual ~MyData() {}
+// ~MyData() override {}
// DISALLOW_COPY_AND_ASSIGN(MyData);
// };
//