diff options
author | dcheng <dcheng@chromium.org> | 2014-10-29 14:27:50 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-29 21:28:20 +0000 |
commit | 30a1b15432dd20cf910f96ec35e27a94f769640e (patch) | |
tree | c9f5ffdb5c802fe2a26a22d499b700b49fe8f509 /components/ownership | |
parent | 6913b7737d6124633109d6e3da31689d7ffef838 (diff) | |
download | chromium_src-30a1b15432dd20cf910f96ec35e27a94f769640e.zip chromium_src-30a1b15432dd20cf910f96ec35e27a94f769640e.tar.gz chromium_src-30a1b15432dd20cf910f96ec35e27a94f769640e.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=caitkp@chromium.org
Review URL: https://codereview.chromium.org/684513002
Cr-Commit-Position: refs/heads/master@{#301931}
Diffstat (limited to 'components/ownership')
-rw-r--r-- | components/ownership/mock_owner_key_util.h | 5 | ||||
-rw-r--r-- | components/ownership/owner_key_util_impl.h | 5 | ||||
-rw-r--r-- | components/ownership/owner_key_util_impl_unittest.cc | 4 | ||||
-rw-r--r-- | components/ownership/owner_settings_service.h | 2 |
4 files changed, 7 insertions, 9 deletions
diff --git a/components/ownership/mock_owner_key_util.h b/components/ownership/mock_owner_key_util.h index 7c4f9cd..4b0cc8d 100644 --- a/components/ownership/mock_owner_key_util.h +++ b/components/ownership/mock_owner_key_util.h @@ -25,9 +25,8 @@ class OWNERSHIP_EXPORT MockOwnerKeyUtil : public OwnerKeyUtil { // OwnerKeyUtil implementation: bool ImportPublicKey(std::vector<uint8>* output) override; #if defined(USE_NSS) - virtual crypto::RSAPrivateKey* FindPrivateKeyInSlot( - const std::vector<uint8>& key, - PK11SlotInfo* slot) override; + crypto::RSAPrivateKey* FindPrivateKeyInSlot(const std::vector<uint8>& key, + PK11SlotInfo* slot) override; #endif // defined(USE_NSS) bool IsPublicKeyPresent() override; diff --git a/components/ownership/owner_key_util_impl.h b/components/ownership/owner_key_util_impl.h index b6f18a7..9358cca 100644 --- a/components/ownership/owner_key_util_impl.h +++ b/components/ownership/owner_key_util_impl.h @@ -22,9 +22,8 @@ class OWNERSHIP_EXPORT OwnerKeyUtilImpl : public OwnerKeyUtil { // OwnerKeyUtil implementation: bool ImportPublicKey(std::vector<uint8>* output) override; #if defined(USE_NSS) - virtual crypto::RSAPrivateKey* FindPrivateKeyInSlot( - const std::vector<uint8>& key, - PK11SlotInfo* slot) override; + crypto::RSAPrivateKey* FindPrivateKeyInSlot(const std::vector<uint8>& key, + PK11SlotInfo* slot) override; #endif // defined(USE_NSS) bool IsPublicKeyPresent() override; diff --git a/components/ownership/owner_key_util_impl_unittest.cc b/components/ownership/owner_key_util_impl_unittest.cc index 950201e..d79b3b2 100644 --- a/components/ownership/owner_key_util_impl_unittest.cc +++ b/components/ownership/owner_key_util_impl_unittest.cc @@ -49,9 +49,9 @@ const uint8 kTestKeyData[] = { class OwnerKeyUtilImplTest : public testing::Test { protected: OwnerKeyUtilImplTest() {} - virtual ~OwnerKeyUtilImplTest() {} + ~OwnerKeyUtilImplTest() override {} - virtual void SetUp() override { + void SetUp() override { ASSERT_TRUE(tmpdir_.CreateUniqueTempDir()); key_file_ = tmpdir_.path().Append(FILE_PATH_LITERAL("key")); util_ = new OwnerKeyUtilImpl(key_file_); diff --git a/components/ownership/owner_settings_service.h b/components/ownership/owner_settings_service.h index db36595..a1d7c52 100644 --- a/components/ownership/owner_settings_service.h +++ b/components/ownership/owner_settings_service.h @@ -59,7 +59,7 @@ class OWNERSHIP_EXPORT OwnerSettingsService : public KeyedService { explicit OwnerSettingsService( const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); - virtual ~OwnerSettingsService(); + ~OwnerSettingsService() override; base::WeakPtr<OwnerSettingsService> as_weak_ptr() { return weak_factory_.GetWeakPtr(); |