Commit 5b68c67d authored by dcheng's avatar dcheng Committed by Commit bot

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=mdm@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#301507}
parent 131bb7e6
......@@ -86,29 +86,28 @@ class NativeBackendGnome : public PasswordStoreX::NativeBackend,
public:
explicit NativeBackendGnome(LocalProfileId id);
virtual ~NativeBackendGnome();
~NativeBackendGnome() override;
virtual bool Init() override;
bool Init() override;
// Implements NativeBackend interface.
virtual password_manager::PasswordStoreChangeList AddLogin(
password_manager::PasswordStoreChangeList AddLogin(
const autofill::PasswordForm& form) override;
virtual bool UpdateLogin(
const autofill::PasswordForm& form,
password_manager::PasswordStoreChangeList* changes) override;
virtual bool RemoveLogin(const autofill::PasswordForm& form) override;
virtual bool RemoveLoginsCreatedBetween(
bool UpdateLogin(const autofill::PasswordForm& form,
password_manager::PasswordStoreChangeList* changes) override;
bool RemoveLogin(const autofill::PasswordForm& form) override;
bool RemoveLoginsCreatedBetween(
base::Time delete_begin,
base::Time delete_end,
password_manager::PasswordStoreChangeList* changes) override;
virtual bool RemoveLoginsSyncedBetween(
bool RemoveLoginsSyncedBetween(
base::Time delete_begin,
base::Time delete_end,
password_manager::PasswordStoreChangeList* changes) override;
virtual bool GetLogins(const autofill::PasswordForm& form,
PasswordFormList* forms) override;
virtual bool GetAutofillableLogins(PasswordFormList* forms) override;
virtual bool GetBlacklistLogins(PasswordFormList* forms) override;
bool GetLogins(const autofill::PasswordForm& form,
PasswordFormList* forms) override;
bool GetAutofillableLogins(PasswordFormList* forms) override;
bool GetBlacklistLogins(PasswordFormList* forms) override;
private:
enum TimestampToCompare {
......
......@@ -338,7 +338,7 @@ class NativeBackendGnomeTest : public testing::Test {
db_thread_(BrowserThread::DB) {
}
virtual void SetUp() {
void SetUp() override {
ASSERT_TRUE(db_thread_.Start());
ASSERT_TRUE(MockGnomeKeyringLoader::LoadMockGnomeKeyring());
......@@ -393,7 +393,7 @@ class NativeBackendGnomeTest : public testing::Test {
other_auth_.date_synced = base::Time::Now();
}
virtual void TearDown() {
void TearDown() override {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::MessageLoop::QuitClosure());
base::MessageLoop::current()->Run();
......
......@@ -35,29 +35,28 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend {
public:
explicit NativeBackendKWallet(LocalProfileId id);
virtual ~NativeBackendKWallet();
~NativeBackendKWallet() override;
virtual bool Init() override;
bool Init() override;
// Implements NativeBackend interface.
virtual password_manager::PasswordStoreChangeList AddLogin(
password_manager::PasswordStoreChangeList AddLogin(
const autofill::PasswordForm& form) override;
virtual bool UpdateLogin(
const autofill::PasswordForm& form,
password_manager::PasswordStoreChangeList* changes) override;
virtual bool RemoveLogin(const autofill::PasswordForm& form) override;
virtual bool RemoveLoginsCreatedBetween(
bool UpdateLogin(const autofill::PasswordForm& form,
password_manager::PasswordStoreChangeList* changes) override;
bool RemoveLogin(const autofill::PasswordForm& form) override;
bool RemoveLoginsCreatedBetween(
base::Time delete_begin,
base::Time delete_end,
password_manager::PasswordStoreChangeList* changes) override;
virtual bool RemoveLoginsSyncedBetween(
bool RemoveLoginsSyncedBetween(
base::Time delete_begin,
base::Time delete_end,
password_manager::PasswordStoreChangeList* changes) override;
virtual bool GetLogins(const autofill::PasswordForm& form,
PasswordFormList* forms) override;
virtual bool GetAutofillableLogins(PasswordFormList* forms) override;
virtual bool GetBlacklistLogins(PasswordFormList* forms) override;
bool GetLogins(const autofill::PasswordForm& form,
PasswordFormList* forms) override;
bool GetAutofillableLogins(PasswordFormList* forms) override;
bool GetBlacklistLogins(PasswordFormList* forms) override;
protected:
// Invalid handle returned by WalletHandle().
......
......@@ -239,8 +239,8 @@ class NativeBackendKWalletTest : public NativeBackendKWalletTestBase {
kwallet_running_(true), kwallet_enabled_(true) {
}
virtual void SetUp();
virtual void TearDown();
void SetUp() override;
void TearDown() override;
// Let the DB thread run to completion of all current tasks.
void RunDBThread() {
......
......@@ -257,7 +257,7 @@ scoped_ptr<net::test_server::HttpResponse> HandleTestAuthRequest(
class PasswordManagerBrowserTest : public InProcessBrowserTest {
public:
PasswordManagerBrowserTest() {}
virtual ~PasswordManagerBrowserTest() {}
~PasswordManagerBrowserTest() override {}
// InProcessBrowserTest:
void SetUpOnMainThread() override {
......
......@@ -75,30 +75,29 @@ class PasswordStoreX : public password_manager::PasswordStoreDefault {
private:
friend class PasswordStoreXTest;
virtual ~PasswordStoreX();
~PasswordStoreX() override;
// Implements PasswordStore interface.
virtual password_manager::PasswordStoreChangeList AddLoginImpl(
password_manager::PasswordStoreChangeList AddLoginImpl(
const autofill::PasswordForm& form) override;
virtual password_manager::PasswordStoreChangeList UpdateLoginImpl(
password_manager::PasswordStoreChangeList UpdateLoginImpl(
const autofill::PasswordForm& form) override;
virtual password_manager::PasswordStoreChangeList RemoveLoginImpl(
password_manager::PasswordStoreChangeList RemoveLoginImpl(
const autofill::PasswordForm& form) override;
virtual password_manager::PasswordStoreChangeList
RemoveLoginsCreatedBetweenImpl(base::Time delete_begin,
base::Time delete_end) override;
virtual password_manager::PasswordStoreChangeList
RemoveLoginsSyncedBetweenImpl(base::Time delete_begin,
base::Time delete_end) override;
virtual void GetLoginsImpl(
const autofill::PasswordForm& form,
AuthorizationPromptPolicy prompt_policy,
const ConsumerCallbackRunner& callback_runner) override;
virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) override;
virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) override;
virtual bool FillAutofillableLogins(
password_manager::PasswordStoreChangeList RemoveLoginsCreatedBetweenImpl(
base::Time delete_begin,
base::Time delete_end) override;
password_manager::PasswordStoreChangeList RemoveLoginsSyncedBetweenImpl(
base::Time delete_begin,
base::Time delete_end) override;
void GetLoginsImpl(const autofill::PasswordForm& form,
AuthorizationPromptPolicy prompt_policy,
const ConsumerCallbackRunner& callback_runner) override;
void GetAutofillableLoginsImpl(GetLoginsRequest* request) override;
void GetBlacklistLoginsImpl(GetLoginsRequest* request) override;
bool FillAutofillableLogins(
std::vector<autofill::PasswordForm*>* forms) override;
virtual bool FillBlacklistLogins(
bool FillBlacklistLogins(
std::vector<autofill::PasswordForm*>* forms) override;
// Sort logins by origin, like the ORDER BY clause in login_database.cc.
......
......@@ -57,56 +57,51 @@ class MockPasswordStoreObserver
class FailingBackend : public PasswordStoreX::NativeBackend {
public:
virtual bool Init() override { return true; }
bool Init() override { return true; }
virtual PasswordStoreChangeList AddLogin(const PasswordForm& form) override {
PasswordStoreChangeList AddLogin(const PasswordForm& form) override {
return PasswordStoreChangeList();
}
virtual bool UpdateLogin(const PasswordForm& form,
PasswordStoreChangeList* changes) override {
bool UpdateLogin(const PasswordForm& form,
PasswordStoreChangeList* changes) override {
return false;
}
virtual bool RemoveLogin(const PasswordForm& form) override { return false; }
bool RemoveLogin(const PasswordForm& form) override { return false; }
virtual bool RemoveLoginsCreatedBetween(
bool RemoveLoginsCreatedBetween(
base::Time delete_begin,
base::Time delete_end,
password_manager::PasswordStoreChangeList* changes) override {
return false;
}
virtual bool RemoveLoginsSyncedBetween(
bool RemoveLoginsSyncedBetween(
base::Time delete_begin,
base::Time delete_end,
password_manager::PasswordStoreChangeList* changes) override {
return false;
}
virtual bool GetLogins(const PasswordForm& form,
PasswordFormList* forms) override {
bool GetLogins(const PasswordForm& form, PasswordFormList* forms) override {
return false;
}
virtual bool GetAutofillableLogins(PasswordFormList* forms) override {
return false;
}
virtual bool GetBlacklistLogins(PasswordFormList* forms) override {
return false;
}
bool GetAutofillableLogins(PasswordFormList* forms) override { return false; }
bool GetBlacklistLogins(PasswordFormList* forms) override { return false; }
};
class MockBackend : public PasswordStoreX::NativeBackend {
public:
virtual bool Init() override { return true; }
bool Init() override { return true; }
virtual PasswordStoreChangeList AddLogin(const PasswordForm& form) override {
PasswordStoreChangeList AddLogin(const PasswordForm& form) override {
all_forms_.push_back(form);
PasswordStoreChange change(PasswordStoreChange::ADD, form);
return PasswordStoreChangeList(1, change);
}
virtual bool UpdateLogin(const PasswordForm& form,
PasswordStoreChangeList* changes) override {
bool UpdateLogin(const PasswordForm& form,
PasswordStoreChangeList* changes) override {
for (size_t i = 0; i < all_forms_.size(); ++i)
if (CompareForms(all_forms_[i], form, true)) {
all_forms_[i] = form;
......@@ -116,14 +111,14 @@ class MockBackend : public PasswordStoreX::NativeBackend {
return true;
}
virtual bool RemoveLogin(const PasswordForm& form) override {
bool RemoveLogin(const PasswordForm& form) override {
for (size_t i = 0; i < all_forms_.size(); ++i)
if (CompareForms(all_forms_[i], form, false))
erase(i--);
return true;
}
virtual bool RemoveLoginsCreatedBetween(
bool RemoveLoginsCreatedBetween(
base::Time delete_begin,
base::Time delete_end,
password_manager::PasswordStoreChangeList* changes) override {
......@@ -135,7 +130,7 @@ class MockBackend : public PasswordStoreX::NativeBackend {
return true;
}
virtual bool RemoveLoginsSyncedBetween(
bool RemoveLoginsSyncedBetween(
base::Time delete_begin,
base::Time delete_end,
password_manager::PasswordStoreChangeList* changes) override {
......@@ -151,22 +146,21 @@ class MockBackend : public PasswordStoreX::NativeBackend {
return true;
}
virtual bool GetLogins(const PasswordForm& form,
PasswordFormList* forms) override {
bool GetLogins(const PasswordForm& form, PasswordFormList* forms) override {
for (size_t i = 0; i < all_forms_.size(); ++i)
if (all_forms_[i].signon_realm == form.signon_realm)
forms->push_back(new PasswordForm(all_forms_[i]));
return true;
}
virtual bool GetAutofillableLogins(PasswordFormList* forms) override {
bool GetAutofillableLogins(PasswordFormList* forms) override {
for (size_t i = 0; i < all_forms_.size(); ++i)
if (!all_forms_[i].blacklisted_by_user)
forms->push_back(new PasswordForm(all_forms_[i]));
return true;
}
virtual bool GetBlacklistLogins(PasswordFormList* forms) override {
bool GetBlacklistLogins(PasswordFormList* forms) override {
for (size_t i = 0; i < all_forms_.size(); ++i)
if (all_forms_[i].blacklisted_by_user)
forms->push_back(new PasswordForm(all_forms_[i]));
......@@ -247,16 +241,14 @@ enum BackendType {
class PasswordStoreXTest : public testing::TestWithParam<BackendType> {
protected:
virtual void SetUp() {
void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
login_db_.reset(new password_manager::LoginDatabase());
ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append("login_test")));
}
virtual void TearDown() {
base::RunLoop().RunUntilIdle();
}
void TearDown() override { base::RunLoop().RunUntilIdle(); }
PasswordStoreX::NativeBackend* GetBackend() {
switch (GetParam()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment