diff options
author | dcheng <dcheng@chromium.org> | 2014-10-27 14:48:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-27 21:48:55 +0000 |
commit | 578ab408a9a10b59297b8364a50987a8dd088cdf (patch) | |
tree | 157fdfba308a708c7a1b2c62e5599aac8243003e /extensions/shell/common | |
parent | 67be2b1f8dbb8fe664365ce33cd6ccf2832e0663 (diff) | |
download | chromium_src-578ab408a9a10b59297b8364a50987a8dd088cdf.zip chromium_src-578ab408a9a10b59297b8364a50987a8dd088cdf.tar.gz chromium_src-578ab408a9a10b59297b8364a50987a8dd088cdf.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=yoz@chromium.org
Review URL: https://codereview.chromium.org/667153007
Cr-Commit-Position: refs/heads/master@{#301453}
Diffstat (limited to 'extensions/shell/common')
-rw-r--r-- | extensions/shell/common/shell_content_client.h | 19 | ||||
-rw-r--r-- | extensions/shell/common/shell_extensions_client.cc | 15 | ||||
-rw-r--r-- | extensions/shell/common/shell_extensions_client.h | 39 |
3 files changed, 34 insertions, 39 deletions
diff --git a/extensions/shell/common/shell_content_client.h b/extensions/shell/common/shell_content_client.h index e30f4d7..4e0e384 100644 --- a/extensions/shell/common/shell_content_client.h +++ b/extensions/shell/common/shell_content_client.h @@ -14,21 +14,20 @@ namespace extensions { class ShellContentClient : public content::ContentClient { public: ShellContentClient(); - virtual ~ShellContentClient(); + ~ShellContentClient() override; - virtual void AddPepperPlugins( + void AddPepperPlugins( std::vector<content::PepperPluginInfo>* plugins) override; - virtual void AddAdditionalSchemes( - std::vector<std::string>* standard_schemes, - std::vector<std::string>* saveable_shemes) override; - virtual std::string GetUserAgent() const override; - virtual base::string16 GetLocalizedString(int message_id) const override; - virtual base::StringPiece GetDataResource( + void AddAdditionalSchemes(std::vector<std::string>* standard_schemes, + std::vector<std::string>* saveable_shemes) override; + std::string GetUserAgent() const override; + base::string16 GetLocalizedString(int message_id) const override; + base::StringPiece GetDataResource( int resource_id, ui::ScaleFactor scale_factor) const override; - virtual base::RefCountedStaticMemory* GetDataResourceBytes( + base::RefCountedStaticMemory* GetDataResourceBytes( int resource_id) const override; - virtual gfx::Image& GetNativeImageNamed(int resource_id) const override; + gfx::Image& GetNativeImageNamed(int resource_id) const override; private: DISALLOW_COPY_AND_ASSIGN(ShellContentClient); diff --git a/extensions/shell/common/shell_extensions_client.cc b/extensions/shell/common/shell_extensions_client.cc index 8eae902..4fc57e8 100644 --- a/extensions/shell/common/shell_extensions_client.cc +++ b/extensions/shell/common/shell_extensions_client.cc @@ -38,31 +38,30 @@ SimpleFeature* CreateFeature() { class ShellPermissionMessageProvider : public PermissionMessageProvider { public: ShellPermissionMessageProvider() {} - virtual ~ShellPermissionMessageProvider() {} + ~ShellPermissionMessageProvider() override {} // PermissionMessageProvider implementation. - virtual PermissionMessages GetPermissionMessages( + PermissionMessages GetPermissionMessages( const PermissionSet* permissions, Manifest::Type extension_type) const override { return PermissionMessages(); } - virtual std::vector<base::string16> GetWarningMessages( + std::vector<base::string16> GetWarningMessages( const PermissionSet* permissions, Manifest::Type extension_type) const override { return std::vector<base::string16>(); } - virtual std::vector<base::string16> GetWarningMessagesDetails( + std::vector<base::string16> GetWarningMessagesDetails( const PermissionSet* permissions, Manifest::Type extension_type) const override { return std::vector<base::string16>(); } - virtual bool IsPrivilegeIncrease( - const PermissionSet* old_permissions, - const PermissionSet* new_permissions, - Manifest::Type extension_type) const override { + bool IsPrivilegeIncrease(const PermissionSet* old_permissions, + const PermissionSet* new_permissions, + Manifest::Type extension_type) const override { // Ensure we implement this before shipping. CHECK(false); return false; diff --git a/extensions/shell/common/shell_extensions_client.h b/extensions/shell/common/shell_extensions_client.h index ba9a330..1b6dece 100644 --- a/extensions/shell/common/shell_extensions_client.h +++ b/extensions/shell/common/shell_extensions_client.h @@ -16,37 +16,34 @@ namespace extensions { class ShellExtensionsClient : public ExtensionsClient { public: ShellExtensionsClient(); - virtual ~ShellExtensionsClient(); + ~ShellExtensionsClient() override; // ExtensionsClient overrides: - virtual void Initialize() override; - virtual const PermissionMessageProvider& GetPermissionMessageProvider() + void Initialize() override; + const PermissionMessageProvider& GetPermissionMessageProvider() const override; - virtual const std::string GetProductName() override; - virtual scoped_ptr<FeatureProvider> CreateFeatureProvider( + const std::string GetProductName() override; + scoped_ptr<FeatureProvider> CreateFeatureProvider( const std::string& name) const override; - virtual scoped_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource( + scoped_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource( const std::string& name) const override; - virtual void FilterHostPermissions( + void FilterHostPermissions( const URLPatternSet& hosts, URLPatternSet* new_hosts, std::set<PermissionMessage>* messages) const override; - virtual void SetScriptingWhitelist( - const ScriptingWhitelist& whitelist) override; - virtual const ScriptingWhitelist& GetScriptingWhitelist() const override; - virtual URLPatternSet GetPermittedChromeSchemeHosts( + void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override; + const ScriptingWhitelist& GetScriptingWhitelist() const override; + URLPatternSet GetPermittedChromeSchemeHosts( const Extension* extension, const APIPermissionSet& api_permissions) const override; - virtual bool IsScriptableURL(const GURL& url, - std::string* error) const override; - virtual bool IsAPISchemaGenerated(const std::string& name) const override; - virtual base::StringPiece GetAPISchema( - const std::string& name) const override; - virtual void RegisterAPISchemaResources(ExtensionAPI* api) const override; - virtual bool ShouldSuppressFatalErrors() const override; - virtual std::string GetWebstoreBaseURL() const override; - virtual std::string GetWebstoreUpdateURL() const override; - virtual bool IsBlacklistUpdateURL(const GURL& url) const override; + bool IsScriptableURL(const GURL& url, std::string* error) const override; + bool IsAPISchemaGenerated(const std::string& name) const override; + base::StringPiece GetAPISchema(const std::string& name) const override; + void RegisterAPISchemaResources(ExtensionAPI* api) const override; + bool ShouldSuppressFatalErrors() const override; + std::string GetWebstoreBaseURL() const override; + std::string GetWebstoreUpdateURL() const override; + bool IsBlacklistUpdateURL(const GURL& url) const override; private: const ExtensionsAPIPermissions extensions_api_permissions_; |