diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 01:07:08 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 01:07:08 +0000 |
commit | 135fd3b65dac543c78543f85f83b4d0ea83d5184 (patch) | |
tree | 154c664fec0b39e5f263cc7a8616c4cdcb983d1d /chrome/browser/autocomplete | |
parent | 20cb5f48d36abeb25bbf6cdd6a5f6debe014e8b1 (diff) | |
download | chromium_src-135fd3b65dac543c78543f85f83b4d0ea83d5184.zip chromium_src-135fd3b65dac543c78543f85f83b4d0ea83d5184.tar.gz chromium_src-135fd3b65dac543c78543f85f83b4d0ea83d5184.tar.bz2 |
Give classes with virtual methods virtual protected d'tors instead of non-virtual public implicit d'tors.
Was originally:
Replace public nonvirtual destructors in classes with virtual members
with protected nonvirtual destructors where possible, and with
public virtual destructors where destruction of a derived class occurs.
(chrome/browser/[a-m]* only)
(Part 4 of http://www.gotw.ca/publications/mill18.htm
has a rationale for why public nonvirtual destructors in classes with
virtual members is dangerous.)
BUG=none
TEST=base_unittests & app_unittests
Review URL: http://codereview.chromium.org/201100
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
4 files changed, 12 insertions, 3 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h index 2a8f1b0..f7de326 100644 --- a/chrome/browser/autocomplete/autocomplete.h +++ b/chrome/browser/autocomplete/autocomplete.h @@ -472,6 +472,9 @@ class AutocompleteProvider // them all again when this is called anyway, so such a parameter wouldn't // actually be useful. virtual void OnProviderUpdate(bool updated_matches) = 0; + + protected: + virtual ~ACProviderListener() {} }; AutocompleteProvider(ACProviderListener* listener, diff --git a/chrome/browser/autocomplete/autocomplete_edit.h b/chrome/browser/autocomplete/autocomplete_edit.h index a4f4e69..1a0386c 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.h +++ b/chrome/browser/autocomplete/autocomplete_edit.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -58,6 +58,9 @@ class AutocompleteEditController { // Returns the title of the current page. virtual std::wstring GetTitle() const = 0; + + protected: + virtual ~AutocompleteEditController() {} }; class AutocompleteEditModel : public NotificationObserver { diff --git a/chrome/browser/autocomplete/autocomplete_edit_view.h b/chrome/browser/autocomplete/autocomplete_edit_view.h index 7a410b6..021b5cd 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -128,6 +128,9 @@ class AutocompleteEditView { // Returns the gfx::NativeView of the edit view. virtual gfx::NativeView GetNativeView() const = 0; + + protected: + virtual ~AutocompleteEditView() {} }; #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_H_ diff --git a/chrome/browser/autocomplete/autocomplete_popup_view.h b/chrome/browser/autocomplete/autocomplete_popup_view.h index 57670c5..f030a9b 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view.h @@ -27,7 +27,7 @@ class Profile; class AutocompletePopupView { public: - virtual ~AutocompletePopupView() { } + virtual ~AutocompletePopupView() {} // Returns true if the popup is currently open. virtual bool IsOpen() const = 0; |