Commit 99b1bc2d authored by dcheng's avatar dcheng Committed by Commit bot

Standardize usage of virtual/override/final in chrome/browser/plugins

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

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

Cr-Commit-Position: refs/heads/master@{#300722}
parent fddd77d6
...@@ -71,19 +71,17 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter, ...@@ -71,19 +71,17 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter,
bool IsPluginRestricted(const base::FilePath& plugin_path); bool IsPluginRestricted(const base::FilePath& plugin_path);
// PluginServiceFilter implementation: // PluginServiceFilter implementation:
virtual bool IsPluginAvailable( bool IsPluginAvailable(int render_process_id,
int render_process_id, int render_frame_id,
int render_frame_id, const void* context,
const void* context, const GURL& url,
const GURL& url, const GURL& policy_url,
const GURL& policy_url, content::WebPluginInfo* plugin) override;
content::WebPluginInfo* plugin) override;
// CanLoadPlugin always grants permission to the browser // CanLoadPlugin always grants permission to the browser
// (render_process_id == 0) // (render_process_id == 0)
virtual bool CanLoadPlugin( bool CanLoadPlugin(int render_process_id,
int render_process_id, const base::FilePath& path) override;
const base::FilePath& path) override;
private: private:
friend struct DefaultSingletonTraits<ChromePluginServiceFilter>; friend struct DefaultSingletonTraits<ChromePluginServiceFilter>;
...@@ -106,12 +104,12 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter, ...@@ -106,12 +104,12 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter,
}; };
ChromePluginServiceFilter(); ChromePluginServiceFilter();
virtual ~ChromePluginServiceFilter(); ~ChromePluginServiceFilter() override;
// content::NotificationObserver implementation: // content::NotificationObserver implementation:
virtual void Observe(int type, void Observe(int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) override; const content::NotificationDetails& details) override;
ProcessDetails* GetOrRegisterProcess(int render_process_id); ProcessDetails* GetOrRegisterProcess(int render_process_id);
const ProcessDetails* GetProcess(int render_process_id) const; const ProcessDetails* GetProcess(int render_process_id) const;
......
...@@ -78,15 +78,15 @@ class PluginInfoMessageFilter : public content::BrowserMessageFilter { ...@@ -78,15 +78,15 @@ class PluginInfoMessageFilter : public content::BrowserMessageFilter {
PluginInfoMessageFilter(int render_process_id, Profile* profile); PluginInfoMessageFilter(int render_process_id, Profile* profile);
// content::BrowserMessageFilter methods: // content::BrowserMessageFilter methods:
virtual bool OnMessageReceived(const IPC::Message& message) override; bool OnMessageReceived(const IPC::Message& message) override;
virtual void OnDestruct() const override; void OnDestruct() const override;
private: private:
friend struct content::BrowserThread::DeleteOnThread< friend struct content::BrowserThread::DeleteOnThread<
content::BrowserThread::UI>; content::BrowserThread::UI>;
friend class base::DeleteHelper<PluginInfoMessageFilter>; friend class base::DeleteHelper<PluginInfoMessageFilter>;
virtual ~PluginInfoMessageFilter(); ~PluginInfoMessageFilter() override;
void OnGetPluginInfo(int render_frame_id, void OnGetPluginInfo(int render_frame_id,
const GURL& url, const GURL& url,
......
...@@ -34,17 +34,17 @@ void PluginsLoaded(const base::Closure& callback, ...@@ -34,17 +34,17 @@ void PluginsLoaded(const base::Closure& callback,
class FakePluginServiceFilter : public content::PluginServiceFilter { class FakePluginServiceFilter : public content::PluginServiceFilter {
public: public:
FakePluginServiceFilter() {} FakePluginServiceFilter() {}
virtual ~FakePluginServiceFilter() {} ~FakePluginServiceFilter() override {}
virtual bool IsPluginAvailable(int render_process_id, bool IsPluginAvailable(int render_process_id,
int render_view_id, int render_view_id,
const void* context, const void* context,
const GURL& url, const GURL& url,
const GURL& policy_url, const GURL& policy_url,
content::WebPluginInfo* plugin) override; content::WebPluginInfo* plugin) override;
virtual bool CanLoadPlugin(int render_process_id, bool CanLoadPlugin(int render_process_id,
const base::FilePath& path) override; const base::FilePath& path) override;
void set_plugin_enabled(const base::FilePath& plugin_path, bool enabled) { void set_plugin_enabled(const base::FilePath& plugin_path, bool enabled) {
plugin_state_[plugin_path] = enabled; plugin_state_[plugin_path] = enabled;
......
...@@ -25,10 +25,10 @@ class WebContents; ...@@ -25,10 +25,10 @@ class WebContents;
class PluginInfoBarDelegate : public ConfirmInfoBarDelegate { class PluginInfoBarDelegate : public ConfirmInfoBarDelegate {
protected: protected:
explicit PluginInfoBarDelegate(const std::string& identifier); explicit PluginInfoBarDelegate(const std::string& identifier);
virtual ~PluginInfoBarDelegate(); ~PluginInfoBarDelegate() override;
// ConfirmInfoBarDelegate: // ConfirmInfoBarDelegate:
virtual bool LinkClicked(WindowOpenDisposition disposition) override; bool LinkClicked(WindowOpenDisposition disposition) override;
virtual std::string GetLearnMoreURL() const = 0; virtual std::string GetLearnMoreURL() const = 0;
...@@ -36,8 +36,8 @@ class PluginInfoBarDelegate : public ConfirmInfoBarDelegate { ...@@ -36,8 +36,8 @@ class PluginInfoBarDelegate : public ConfirmInfoBarDelegate {
private: private:
// ConfirmInfoBarDelegate: // ConfirmInfoBarDelegate:
virtual int GetIconID() const override; int GetIconID() const override;
virtual base::string16 GetLinkText() const override; base::string16 GetLinkText() const override;
std::string identifier_; std::string identifier_;
...@@ -58,16 +58,16 @@ class UnauthorizedPluginInfoBarDelegate : public PluginInfoBarDelegate { ...@@ -58,16 +58,16 @@ class UnauthorizedPluginInfoBarDelegate : public PluginInfoBarDelegate {
UnauthorizedPluginInfoBarDelegate(HostContentSettingsMap* content_settings, UnauthorizedPluginInfoBarDelegate(HostContentSettingsMap* content_settings,
const base::string16& name, const base::string16& name,
const std::string& identifier); const std::string& identifier);
virtual ~UnauthorizedPluginInfoBarDelegate(); ~UnauthorizedPluginInfoBarDelegate() override;
// PluginInfoBarDelegate: // PluginInfoBarDelegate:
virtual base::string16 GetMessageText() const override; base::string16 GetMessageText() const override;
virtual base::string16 GetButtonLabel(InfoBarButton button) const override; base::string16 GetButtonLabel(InfoBarButton button) const override;
virtual bool Accept() override; bool Accept() override;
virtual bool Cancel() override; bool Cancel() override;
virtual void InfoBarDismissed() override; void InfoBarDismissed() override;
virtual bool LinkClicked(WindowOpenDisposition disposition) override; bool LinkClicked(WindowOpenDisposition disposition) override;
virtual std::string GetLearnMoreURL() const override; std::string GetLearnMoreURL() const override;
HostContentSettingsMap* content_settings_; HostContentSettingsMap* content_settings_;
base::string16 name_; base::string16 name_;
...@@ -90,25 +90,25 @@ class OutdatedPluginInfoBarDelegate : public PluginInfoBarDelegate, ...@@ -90,25 +90,25 @@ class OutdatedPluginInfoBarDelegate : public PluginInfoBarDelegate,
OutdatedPluginInfoBarDelegate(PluginInstaller* installer, OutdatedPluginInfoBarDelegate(PluginInstaller* installer,
scoped_ptr<PluginMetadata> metadata, scoped_ptr<PluginMetadata> metadata,
const base::string16& message); const base::string16& message);
virtual ~OutdatedPluginInfoBarDelegate(); ~OutdatedPluginInfoBarDelegate() override;
// PluginInfoBarDelegate: // PluginInfoBarDelegate:
virtual base::string16 GetMessageText() const override; base::string16 GetMessageText() const override;
virtual base::string16 GetButtonLabel(InfoBarButton button) const override; base::string16 GetButtonLabel(InfoBarButton button) const override;
virtual bool Accept() override; bool Accept() override;
virtual bool Cancel() override; bool Cancel() override;
virtual void InfoBarDismissed() override; void InfoBarDismissed() override;
virtual bool LinkClicked(WindowOpenDisposition disposition) override; bool LinkClicked(WindowOpenDisposition disposition) override;
virtual std::string GetLearnMoreURL() const override; std::string GetLearnMoreURL() const override;
// PluginInstallerObserver: // PluginInstallerObserver:
virtual void DownloadStarted() override; void DownloadStarted() override;
virtual void DownloadError(const std::string& message) override; void DownloadError(const std::string& message) override;
virtual void DownloadCancelled() override; void DownloadCancelled() override;
virtual void DownloadFinished() override; void DownloadFinished() override;
// WeakPluginInstallerObserver: // WeakPluginInstallerObserver:
virtual void OnlyWeakObserversLeft() override; void OnlyWeakObserversLeft() override;
// Replaces this infobar with one showing |message|. The new infobar will // Replaces this infobar with one showing |message|. The new infobar will
// not have any buttons (and not call the callback). // not have any buttons (and not call the callback).
...@@ -151,25 +151,25 @@ class PluginInstallerInfoBarDelegate : public ConfirmInfoBarDelegate, ...@@ -151,25 +151,25 @@ class PluginInstallerInfoBarDelegate : public ConfirmInfoBarDelegate,
const InstallCallback& callback, const InstallCallback& callback,
bool new_install, bool new_install,
const base::string16& message); const base::string16& message);
virtual ~PluginInstallerInfoBarDelegate(); ~PluginInstallerInfoBarDelegate() override;
// ConfirmInfoBarDelegate: // ConfirmInfoBarDelegate:
virtual int GetIconID() const override; int GetIconID() const override;
virtual base::string16 GetMessageText() const override; base::string16 GetMessageText() const override;
virtual int GetButtons() const override; int GetButtons() const override;
virtual base::string16 GetButtonLabel(InfoBarButton button) const override; base::string16 GetButtonLabel(InfoBarButton button) const override;
virtual bool Accept() override; bool Accept() override;
virtual base::string16 GetLinkText() const override; base::string16 GetLinkText() const override;
virtual bool LinkClicked(WindowOpenDisposition disposition) override; bool LinkClicked(WindowOpenDisposition disposition) override;
// PluginInstallerObserver: // PluginInstallerObserver:
virtual void DownloadStarted() override; void DownloadStarted() override;
virtual void DownloadError(const std::string& message) override; void DownloadError(const std::string& message) override;
virtual void DownloadCancelled() override; void DownloadCancelled() override;
virtual void DownloadFinished() override; void DownloadFinished() override;
// WeakPluginInstallerObserver: // WeakPluginInstallerObserver:
virtual void OnlyWeakObserversLeft() override; void OnlyWeakObserversLeft() override;
// Replaces this infobar with one showing |message|. The new infobar will // Replaces this infobar with one showing |message|. The new infobar will
// not have any buttons (and not call the callback). // not have any buttons (and not call the callback).
......
...@@ -31,10 +31,10 @@ class PluginInstaller : public content::DownloadItem::Observer { ...@@ -31,10 +31,10 @@ class PluginInstaller : public content::DownloadItem::Observer {
}; };
PluginInstaller(); PluginInstaller();
virtual ~PluginInstaller(); ~PluginInstaller() override;
virtual void OnDownloadUpdated(content::DownloadItem* download) override; void OnDownloadUpdated(content::DownloadItem* download) override;
virtual void OnDownloadDestroyed(content::DownloadItem* download) override; void OnDownloadDestroyed(content::DownloadItem* download) override;
void AddObserver(PluginInstallerObserver* observer); void AddObserver(PluginInstallerObserver* observer);
void RemoveObserver(PluginInstallerObserver* observer); void RemoveObserver(PluginInstallerObserver* observer);
......
...@@ -35,7 +35,7 @@ class PluginInstallerObserver { ...@@ -35,7 +35,7 @@ class PluginInstallerObserver {
class WeakPluginInstallerObserver : public PluginInstallerObserver { class WeakPluginInstallerObserver : public PluginInstallerObserver {
public: public:
explicit WeakPluginInstallerObserver(PluginInstaller* installer); explicit WeakPluginInstallerObserver(PluginInstaller* installer);
virtual ~WeakPluginInstallerObserver(); ~WeakPluginInstallerObserver() override;
private: private:
friend class PluginInstaller; friend class PluginInstaller;
......
...@@ -68,12 +68,12 @@ class TestPluginInstallerObserver : public PluginInstallerObserver { ...@@ -68,12 +68,12 @@ class TestPluginInstallerObserver : public PluginInstallerObserver {
const std::string& download_error() const { return download_error_; } const std::string& download_error() const { return download_error_; }
private: private:
virtual void DownloadStarted() override { download_started_ = true; } void DownloadStarted() override { download_started_ = true; }
virtual void DownloadFinished() override { download_finished_ = true; } void DownloadFinished() override { download_finished_ = true; }
virtual void DownloadError(const std::string& message) override { void DownloadError(const std::string& message) override {
download_error_ = message; download_error_ = message;
} }
virtual void DownloadCancelled() override { download_cancelled_ = true; } void DownloadCancelled() override { download_cancelled_ = true; }
bool download_started_; bool download_started_;
bool download_finished_; bool download_finished_;
......
...@@ -64,15 +64,15 @@ class ConfirmInstallDialogDelegate : public TabModalConfirmDialogDelegate, ...@@ -64,15 +64,15 @@ class ConfirmInstallDialogDelegate : public TabModalConfirmDialogDelegate,
scoped_ptr<PluginMetadata> plugin_metadata); scoped_ptr<PluginMetadata> plugin_metadata);
// TabModalConfirmDialogDelegate methods: // TabModalConfirmDialogDelegate methods:
virtual base::string16 GetTitle() override; base::string16 GetTitle() override;
virtual base::string16 GetDialogMessage() override; base::string16 GetDialogMessage() override;
virtual base::string16 GetAcceptButtonTitle() override; base::string16 GetAcceptButtonTitle() override;
virtual void OnAccepted() override; void OnAccepted() override;
virtual void OnCanceled() override; void OnCanceled() override;
// WeakPluginInstallerObserver methods: // WeakPluginInstallerObserver methods:
virtual void DownloadStarted() override; void DownloadStarted() override;
virtual void OnlyWeakObserversLeft() override; void OnlyWeakObserversLeft() override;
private: private:
content::WebContents* web_contents_; content::WebContents* web_contents_;
...@@ -131,14 +131,14 @@ class ReloadPluginInfoBarDelegate : public ConfirmInfoBarDelegate { ...@@ -131,14 +131,14 @@ class ReloadPluginInfoBarDelegate : public ConfirmInfoBarDelegate {
private: private:
ReloadPluginInfoBarDelegate(content::NavigationController* controller, ReloadPluginInfoBarDelegate(content::NavigationController* controller,
const base::string16& message); const base::string16& message);
virtual ~ReloadPluginInfoBarDelegate(); ~ReloadPluginInfoBarDelegate() override;
// ConfirmInfobarDelegate: // ConfirmInfobarDelegate:
virtual int GetIconID() const override; int GetIconID() const override;
virtual base::string16 GetMessageText() const override; base::string16 GetMessageText() const override;
virtual int GetButtons() const override; int GetButtons() const override;
virtual base::string16 GetButtonLabel(InfoBarButton button) const override; base::string16 GetButtonLabel(InfoBarButton button) const override;
virtual bool Accept() override; bool Accept() override;
content::NavigationController* controller_; content::NavigationController* controller_;
base::string16 message_; base::string16 message_;
...@@ -214,19 +214,19 @@ class PluginObserver::PluginPlaceholderHost : public PluginInstallerObserver { ...@@ -214,19 +214,19 @@ class PluginObserver::PluginPlaceholderHost : public PluginInstallerObserver {
} }
// PluginInstallerObserver methods: // PluginInstallerObserver methods:
virtual void DownloadStarted() override { void DownloadStarted() override {
observer_->Send(new ChromeViewMsg_StartedDownloadingPlugin(routing_id_)); observer_->Send(new ChromeViewMsg_StartedDownloadingPlugin(routing_id_));
} }
virtual void DownloadError(const std::string& msg) override { void DownloadError(const std::string& msg) override {
observer_->Send(new ChromeViewMsg_ErrorDownloadingPlugin(routing_id_, msg)); observer_->Send(new ChromeViewMsg_ErrorDownloadingPlugin(routing_id_, msg));
} }
virtual void DownloadCancelled() override { void DownloadCancelled() override {
observer_->Send(new ChromeViewMsg_CancelledDownloadingPlugin(routing_id_)); observer_->Send(new ChromeViewMsg_CancelledDownloadingPlugin(routing_id_));
} }
virtual void DownloadFinished() override { void DownloadFinished() override {
observer_->Send(new ChromeViewMsg_FinishedDownloadingPlugin(routing_id_)); observer_->Send(new ChromeViewMsg_FinishedDownloadingPlugin(routing_id_));
} }
......
...@@ -34,17 +34,15 @@ class InfoBarDelegate; ...@@ -34,17 +34,15 @@ class InfoBarDelegate;
class PluginObserver : public content::WebContentsObserver, class PluginObserver : public content::WebContentsObserver,
public content::WebContentsUserData<PluginObserver> { public content::WebContentsUserData<PluginObserver> {
public: public:
virtual ~PluginObserver(); ~PluginObserver() override;
// content::WebContentsObserver implementation. // content::WebContentsObserver implementation.
virtual void RenderFrameCreated( void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
content::RenderFrameHost* render_frame_host) override; void PluginCrashed(const base::FilePath& plugin_path,
virtual void PluginCrashed(const base::FilePath& plugin_path, base::ProcessId plugin_pid) override;
base::ProcessId plugin_pid) override; bool OnMessageReceived(const IPC::Message& message,
virtual bool OnMessageReceived( content::RenderFrameHost* render_frame_host) override;
const IPC::Message& message, bool OnMessageReceived(const IPC::Message& message) override;
content::RenderFrameHost* render_frame_host) override;
virtual bool OnMessageReceived(const IPC::Message& message) override;
private: private:
explicit PluginObserver(content::WebContents* web_contents); explicit PluginObserver(content::WebContents* web_contents);
......
...@@ -75,7 +75,7 @@ class PluginPrefs : public RefcountedKeyedService { ...@@ -75,7 +75,7 @@ class PluginPrefs : public RefcountedKeyedService {
void set_profile(Profile* profile) { profile_ = profile; } void set_profile(Profile* profile) { profile_ = profile; }
// RefCountedProfileKeyedBase method override. // RefCountedProfileKeyedBase method override.
virtual void ShutdownOnUIThread() override; void ShutdownOnUIThread() override;
private: private:
friend class base::RefCountedThreadSafe<PluginPrefs>; friend class base::RefCountedThreadSafe<PluginPrefs>;
...@@ -100,7 +100,7 @@ class PluginPrefs : public RefcountedKeyedService { ...@@ -100,7 +100,7 @@ class PluginPrefs : public RefcountedKeyedService {
std::map<base::FilePath, bool> state_; std::map<base::FilePath, bool> state_;
}; };
virtual ~PluginPrefs(); ~PluginPrefs() override;
// Called to update one of the policy_xyz patterns below when a // Called to update one of the policy_xyz patterns below when a
// preference changes. // preference changes.
......
...@@ -27,19 +27,19 @@ class PluginPrefsFactory : public RefcountedBrowserContextKeyedServiceFactory { ...@@ -27,19 +27,19 @@ class PluginPrefsFactory : public RefcountedBrowserContextKeyedServiceFactory {
content::BrowserContext* profile); content::BrowserContext* profile);
PluginPrefsFactory(); PluginPrefsFactory();
virtual ~PluginPrefsFactory(); ~PluginPrefsFactory() override;
// RefcountedBrowserContextKeyedServiceFactory methods: // RefcountedBrowserContextKeyedServiceFactory methods:
virtual scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor( scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor(
content::BrowserContext* context) const override; content::BrowserContext* context) const override;
// BrowserContextKeyedServiceFactory methods: // BrowserContextKeyedServiceFactory methods:
virtual void RegisterProfilePrefs( void RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) override; user_prefs::PrefRegistrySyncable* registry) override;
virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override; content::BrowserContext* context) const override;
virtual bool ServiceIsNULLWhileTesting() const override; bool ServiceIsNULLWhileTesting() const override;
virtual bool ServiceIsCreatedWithBrowserContext() const override; bool ServiceIsCreatedWithBrowserContext() const override;
}; };
#endif // CHROME_BROWSER_PLUGINS_PLUGIN_PREFS_FACTORY_H_ #endif // CHROME_BROWSER_PLUGINS_PLUGIN_PREFS_FACTORY_H_
...@@ -28,7 +28,7 @@ struct WebPluginInfo; ...@@ -28,7 +28,7 @@ struct WebPluginInfo;
class PluginStatusPrefSetter : public content::NotificationObserver { class PluginStatusPrefSetter : public content::NotificationObserver {
public: public:
PluginStatusPrefSetter(); PluginStatusPrefSetter();
virtual ~PluginStatusPrefSetter(); ~PluginStatusPrefSetter() override;
// Binds the preferences in the profile's PrefService, notifying |observer| if // Binds the preferences in the profile's PrefService, notifying |observer| if
// any value changes. // any value changes.
...@@ -46,9 +46,9 @@ class PluginStatusPrefSetter : public content::NotificationObserver { ...@@ -46,9 +46,9 @@ class PluginStatusPrefSetter : public content::NotificationObserver {
} }
// content::NotificationObserver methods: // content::NotificationObserver methods:
virtual void Observe(int type, void Observe(int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) override; const content::NotificationDetails& details) override;
private: private:
void StartUpdate(); void StartUpdate();
......
...@@ -21,10 +21,10 @@ class PluginsResourceService : public WebResourceService { ...@@ -21,10 +21,10 @@ class PluginsResourceService : public WebResourceService {
static void RegisterPrefs(PrefRegistrySimple* registry); static void RegisterPrefs(PrefRegistrySimple* registry);
private: private:
virtual ~PluginsResourceService(); ~PluginsResourceService() override;
// WebResourceService override to process the parsed information. // WebResourceService override to process the parsed information.
virtual void Unpack(const base::DictionaryValue& parsed_json) override; void Unpack(const base::DictionaryValue& parsed_json) override;
DISALLOW_COPY_AND_ASSIGN(PluginsResourceService); DISALLOW_COPY_AND_ASSIGN(PluginsResourceService);
}; };
......
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