0

Standardize usage of virtual/override/final specifiers in sql/.

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.

Several formatting edits by clang-format were manually reverted, due to
mangling of some of the more complicate IPC macros.

BUG=417463

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

Cr-Commit-Position: refs/heads/master@{#309480}
This commit is contained in:
dcheng
2014-12-22 15:00:24 -08:00
committed by Commit bot
parent 2c695fc21e
commit 1b3b125e90
7 changed files with 15 additions and 25 deletions

@ -90,15 +90,13 @@ class ScopedUmaskSetter {
class SQLConnectionTest : public testing::Test {
public:
virtual void SetUp() {
void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
db_path_ = temp_dir_.path().AppendASCII("SQLConnectionTest.db");
ASSERT_TRUE(db_.Open(db_path_));
}
virtual void TearDown() {
db_.Close();
}
void TearDown() override { db_.Close(); }
sql::Connection& db() { return db_; }
const base::FilePath& db_path() { return db_path_; }

@ -14,14 +14,12 @@ namespace {
class SQLMetaTableTest : public testing::Test {
public:
virtual void SetUp() {
void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(db_.Open(temp_dir_.path().AppendASCII("SQLMetaTableTest.db")));
}
virtual void TearDown() {
db_.Close();
}
void TearDown() override { db_.Close(); }
sql::Connection& db() { return db_; }

@ -65,14 +65,12 @@ class SQLRecoveryTest : public testing::Test {
public:
SQLRecoveryTest() {}
virtual void SetUp() {
void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(db_.Open(db_path()));
}
virtual void TearDown() {
db_.Close();
}
void TearDown() override { db_.Close(); }
sql::Connection& db() { return db_; }

@ -27,7 +27,7 @@ class SQLiteFeaturesTest : public testing::Test {
public:
SQLiteFeaturesTest() : error_(SQLITE_OK) {}
virtual void SetUp() {
void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(db_.Open(temp_dir_.path().AppendASCII("SQLStatementTest.db")));
@ -37,7 +37,7 @@ class SQLiteFeaturesTest : public testing::Test {
&error_, &sql_text_));
}
virtual void TearDown() {
void TearDown() override {
// If any error happened the original sql statement can be found in
// |sql_text_|.
EXPECT_EQ(SQLITE_OK, error_);

@ -18,14 +18,12 @@ namespace {
class SQLStatementTest : public testing::Test {
public:
virtual void SetUp() {
void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(db_.Open(temp_dir_.path().AppendASCII("SQLStatementTest.db")));
}
virtual void TearDown() {
db_.Close();
}
void TearDown() override { db_.Close(); }
sql::Connection& db() { return db_; }

@ -13,12 +13,12 @@ namespace sql {
class SQLTestSuite : public base::TestSuite {
public:
SQLTestSuite(int argc, char** argv);
virtual ~SQLTestSuite();
~SQLTestSuite() override;
protected:
// Overridden from base::TestSuite:
virtual void Initialize() override;
virtual void Shutdown() override;
void Initialize() override;
void Shutdown() override;
private:
DISALLOW_COPY_AND_ASSIGN(SQLTestSuite);

@ -12,7 +12,7 @@
class SQLTransactionTest : public testing::Test {
public:
virtual void SetUp() {
void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(db_.Open(
temp_dir_.path().AppendASCII("SQLTransactionTest.db")));
@ -20,9 +20,7 @@ class SQLTransactionTest : public testing::Test {
ASSERT_TRUE(db().Execute("CREATE TABLE foo (a, b)"));
}
virtual void TearDown() {
db_.Close();
}
void TearDown() override { db_.Close(); }
sql::Connection& db() { return db_; }