Skip to content

Commit

Permalink
Virtual destructors should have virtual keyword.
Browse files Browse the repository at this point in the history
Make sure user-declared virtual destructors always have the virtual keyword.
The Clang style-check plugin will check for this soon.

No functionality change: virtual is only added
to destructors that are already implicitly virtual.

Also fix a couple of in-line destructor definitions.

BUG=83408
TEST=none

Review URL: http://codereview.chromium.org/7064033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86587 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
hans@chromium.org committed May 25, 2011
1 parent eef99b6 commit 3690ebe
Show file tree
Hide file tree
Showing 242 changed files with 331 additions and 324 deletions.
2 changes: 1 addition & 1 deletion base/message_loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class BASE_API MessageLoop : public base::MessagePump::Delegate {
// Normally, it is not necessary to instantiate a MessageLoop. Instead, it
// is typical to make use of the current thread's MessageLoop instance.
explicit MessageLoop(Type type = TYPE_DEFAULT);
~MessageLoop();
virtual ~MessageLoop();

// Returns the MessageLoop object for the current thread, or null if none.
static MessageLoop* current();
Expand Down
2 changes: 1 addition & 1 deletion base/message_pump_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace base {
class MessagePumpDefault : public MessagePump {
public:
MessagePumpDefault();
~MessagePumpDefault() {}
virtual ~MessagePumpDefault() {}

// MessagePump methods:
virtual void Run(Delegate* delegate);
Expand Down
2 changes: 1 addition & 1 deletion base/synchronization/waitable_event_watcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class BASE_API WaitableEventWatcher
public:

WaitableEventWatcher();
~WaitableEventWatcher();
virtual ~WaitableEventWatcher();

class Delegate {
public:
Expand Down
2 changes: 1 addition & 1 deletion base/task_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class BASE_API TaskQueue : public Task {
public:
TaskQueue();
~TaskQueue();
virtual ~TaskQueue();

// Push the specified task onto the queue. When the queue is run, the tasks
// will be run in the order they are pushed.
Expand Down
2 changes: 1 addition & 1 deletion base/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class BASE_API ListValue : public Value {
typedef ValueVector::const_iterator const_iterator;

ListValue();
~ListValue();
virtual ~ListValue();

// Clears the contents of this ListValue
void Clear();
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autocomplete/autocomplete_edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class AutocompleteEditModel : public AutocompleteControllerDelegate {
AutocompleteEditModel(OmniboxView* view,
AutocompleteEditController* controller,
Profile* profile);
~AutocompleteEditModel();
virtual ~AutocompleteEditModel();

AutocompleteController* autocomplete_controller() const {
return autocomplete_controller_.get();
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autocomplete/autocomplete_popup_view_gtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AutocompletePopupViewGtk : public AutocompletePopupView,
AutocompleteEditModel* edit_model,
Profile* profile,
GtkWidget* location_bar);
~AutocompletePopupViewGtk();
virtual ~AutocompletePopupViewGtk();

// Overridden from AutocompletePopupView:
virtual bool IsOpen() const;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autocomplete/history_contents_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class HistoryContentsProvider : public HistoryProvider {
virtual void Stop() OVERRIDE;

private:
~HistoryContentsProvider();
virtual ~HistoryContentsProvider();

void QueryComplete(HistoryService::Handle handle,
history::QueryResults* results);
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autocomplete/history_quick_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class HistoryQuickProvider : public HistoryProvider {
public:
HistoryQuickProvider(ACProviderListener* listener, Profile* profile);

~HistoryQuickProvider();
virtual ~HistoryQuickProvider();

// AutocompleteProvider. |minimal_changes| is ignored since there
// is no asynch completion performed.
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autocomplete/search_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class SearchProvider : public AutocompleteProvider,
static const int kKeywordProviderURLFetcherID;

private:
~SearchProvider();
virtual ~SearchProvider();

// Manages the providers (TemplateURLs) used by SearchProvider. Two providers
// may be used:
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/background_application_list_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BackgroundApplicationListModel : public NotificationObserver {
// Create a new model associated with profile.
explicit BackgroundApplicationListModel(Profile* profile);

~BackgroundApplicationListModel();
virtual ~BackgroundApplicationListModel();

// Associate observer with this model.
void AddObserver(Observer* observer);
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/bookmarks/bookmark_html_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BookmarkFaviconFetcher: public NotificationObserver {
BookmarkFaviconFetcher(Profile* profile,
const FilePath& path,
BookmarksExportObserver* observer);
~BookmarkFaviconFetcher();
virtual ~BookmarkFaviconFetcher();

// Executes bookmark export process.
void ExportBookmarks();
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/bookmarks/bookmark_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class BookmarkStorage : public NotificationObserver,
private:
friend class base::RefCountedThreadSafe<BookmarkStorage>;

~BookmarkStorage();
virtual ~BookmarkStorage();

class LoadTask;

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/browsing_data_remover.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class BrowsingDataRemover : public NotificationObserver,
// to be deleted by other objects so make destructor private and DeleteTask
// a friend.
friend class DeleteTask<BrowsingDataRemover>;
~BrowsingDataRemover();
virtual ~BrowsingDataRemover();

// NotificationObserver method. Callback when TemplateURLModel has finished
// loading. Deletes the entries from the model, and if we're not waiting on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class PolicyProvider : public BaseProvider,
public:
explicit PolicyProvider(Profile* profile,
DefaultProviderInterface* default_provider);
~PolicyProvider();
virtual ~PolicyProvider();
static void RegisterUserPrefs(PrefService* prefs);

// BaseProvider Implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class HostContentSettingsMap
friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
friend class DeleteTask<HostContentSettingsMap>;

~HostContentSettingsMap();
virtual ~HostContentSettingsMap();

void UnregisterObservers();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BrowserListTabContentsProvider :
public DevToolsHttpProtocolHandler::TabContentsProvider {
public:
BrowserListTabContentsProvider() {}
~BrowserListTabContentsProvider() {}
virtual ~BrowserListTabContentsProvider() {}

virtual DevToolsHttpProtocolHandler::InspectableTabs GetInspectableTabs();
private:
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/debugger/devtools_netlog_observer.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class DevToolsNetLogObserver: public ChromeNetLog::ThreadSafeObserver {
static DevToolsNetLogObserver* instance_;

explicit DevToolsNetLogObserver(ChromeNetLog* chrome_net_log);
~DevToolsNetLogObserver();
virtual ~DevToolsNetLogObserver();

ResourceInfo* GetResourceInfo(uint32 id);

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/debugger/inspectable_tab_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class DevToolsClientHostImpl : public DevToolsClientHost {
int32 id,
DebuggerRemoteService* service,
InspectableTabProxy::IdToClientHostMap* map);
~DevToolsClientHostImpl();
virtual ~DevToolsClientHostImpl();

DebuggerRemoteService* debugger_remote_service() {
return service_;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/download/download_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class DownloadManager
friend class DeleteTask<DownloadManager>;
friend class OtherDownloadManagerObserver;

~DownloadManager();
virtual ~DownloadManager();

// Called on the download thread to check whether the suggested file path
// exists. We don't check if the file exists on the UI thread to avoid UI
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/download/save_package.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class SavePackage : public base::RefCountedThreadSafe<SavePackage>,
const FilePath& file_full_path,
const FilePath& directory_full_path);

~SavePackage();
virtual ~SavePackage();

// Notes from Init() above applies here as well.
void InternalInit();
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/crx_installer.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class CrxInstaller
}

private:
~CrxInstaller();
virtual ~CrxInstaller();

// Converts the source user script to an extension.
void ConvertUserScriptOnFileThread();
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_apitest.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ExtensionApiTest : public ExtensionBrowserTest {
class ResultCatcher : public NotificationObserver {
public:
ResultCatcher();
~ResultCatcher();
virtual ~ResultCatcher();

// Pumps the UI loop until a notification is received that an API test
// succeeded or failed. Returns true if the test succeeded, false otherwise.
Expand Down
10 changes: 5 additions & 5 deletions chrome/browser/extensions/extension_browser_actions_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,36 @@ class BrowserActionFunction : public SyncExtensionFunction {

// Implement chrome.browserAction.setIcon().
class BrowserActionSetIconFunction : public BrowserActionFunction {
~BrowserActionSetIconFunction() {}
virtual ~BrowserActionSetIconFunction() {}
virtual bool RunBrowserAction();
DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setIcon")
};

// Implement chrome.browserAction.setTitle().
class BrowserActionSetTitleFunction : public BrowserActionFunction {
~BrowserActionSetTitleFunction() {}
virtual ~BrowserActionSetTitleFunction() {}
virtual bool RunBrowserAction();
DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setTitle")
};

// Implement chrome.browserActions.setPopup().
class BrowserActionSetPopupFunction : public BrowserActionFunction {
~BrowserActionSetPopupFunction() {}
virtual ~BrowserActionSetPopupFunction() {}
virtual bool RunBrowserAction();
DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setPopup")
};

// Implement chrome.browserAction.setBadgeText().
class BrowserActionSetBadgeTextFunction : public BrowserActionFunction {
~BrowserActionSetBadgeTextFunction() {}
virtual ~BrowserActionSetBadgeTextFunction() {}
virtual bool RunBrowserAction();
DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setBadgeText")
};

// Implement chrome.browserAction.setBadgeBackgroundColor().
class BrowserActionSetBadgeBackgroundColorFunction
: public BrowserActionFunction {
~BrowserActionSetBadgeBackgroundColorFunction() {}
virtual ~BrowserActionSetBadgeBackgroundColorFunction() {}
virtual bool RunBrowserAction();
DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setBadgeBackgroundColor")
};
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_browser_event_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ExtensionBrowserEventRouter : public TabStripModelObserver,
public NotificationObserver {
public:
explicit ExtensionBrowserEventRouter(Profile* profile);
~ExtensionBrowserEventRouter();
virtual ~ExtensionBrowserEventRouter();

// Must be called once. Subsequent calls have no effect.
void Init();
Expand Down
10 changes: 5 additions & 5 deletions chrome/browser/extensions/extension_context_menu_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ExtensionMenuItem;

class ExtensionContextMenuFunction : public SyncExtensionFunction {
public:
~ExtensionContextMenuFunction() {}
virtual ~ExtensionContextMenuFunction() {}

protected:
// Helper function to read and parse a list of menu item contexts.
Expand Down Expand Up @@ -60,25 +60,25 @@ class ExtensionContextMenuFunction : public SyncExtensionFunction {
};

class CreateContextMenuFunction : public ExtensionContextMenuFunction {
~CreateContextMenuFunction() {}
virtual ~CreateContextMenuFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("contextMenus.create")
};

class UpdateContextMenuFunction : public ExtensionContextMenuFunction {
~UpdateContextMenuFunction() {}
virtual ~UpdateContextMenuFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("contextMenus.update")
};

class RemoveContextMenuFunction : public ExtensionContextMenuFunction {
~RemoveContextMenuFunction() {}
virtual ~RemoveContextMenuFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("contextMenus.remove")
};

class RemoveAllContextMenusFunction : public ExtensionContextMenuFunction {
~RemoveAllContextMenusFunction() {}
virtual ~RemoveAllContextMenusFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("contextMenus.removeAll")
};
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/extension_debugger_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class DebuggerFunction : public AsyncExtensionFunction {
class AttachDebuggerFunction : public DebuggerFunction {
public:
AttachDebuggerFunction();
~AttachDebuggerFunction();
virtual ~AttachDebuggerFunction();
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("experimental.debugger.attach")
};
Expand All @@ -43,7 +43,7 @@ class AttachDebuggerFunction : public DebuggerFunction {
class DetachDebuggerFunction : public DebuggerFunction {
public:
DetachDebuggerFunction();
~DetachDebuggerFunction();
virtual ~DetachDebuggerFunction();
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("experimental.debugger.detach")
};
Expand All @@ -52,7 +52,7 @@ class DetachDebuggerFunction : public DebuggerFunction {
class SendRequestDebuggerFunction : public DebuggerFunction {
public:
SendRequestDebuggerFunction();
~SendRequestDebuggerFunction();
virtual ~SendRequestDebuggerFunction();
virtual bool RunImpl();

void SendResponseBody(DictionaryValue* dictionary);
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_event_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ExtensionEventRouter : public NotificationObserver {
static bool CanCrossIncognito(Profile* profile, const Extension* extension);

explicit ExtensionEventRouter(Profile* profile);
~ExtensionEventRouter();
virtual ~ExtensionEventRouter();

// Add or remove the process/extension pair as a listener for |event_name|.
// Note that multiple extensions can share a process due to process
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_history_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class HistoryFunction : public AsyncExtensionFunction {
class HistoryFunctionWithCallback : public HistoryFunction {
public:
HistoryFunctionWithCallback();
~HistoryFunctionWithCallback();
virtual ~HistoryFunctionWithCallback();

// Return true if the async call was completed, false otherwise.
virtual bool RunAsyncImpl() = 0;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ExtensionHost : public RenderViewHostDelegate,

ExtensionHost(const Extension* extension, SiteInstance* site_instance,
const GURL& url, ViewType::Type host_type);
~ExtensionHost();
virtual ~ExtensionHost();

#if defined(TOOLKIT_VIEWS)
void set_view(ExtensionView* view) { view_.reset(view); }
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_i18n_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "chrome/browser/extensions/extension_function.h"

class GetAcceptLanguagesFunction : public SyncExtensionFunction {
~GetAcceptLanguagesFunction() {}
virtual ~GetAcceptLanguagesFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("i18n.getAcceptLanguages")
};
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_infobar_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "chrome/browser/extensions/extension_function.h"

class ShowInfoBarFunction : public SyncExtensionFunction {
~ShowInfoBarFunction() {}
virtual ~ShowInfoBarFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("experimental.infobars.show")
};
Expand Down
Loading

0 comments on commit 3690ebe

Please sign in to comment.