diff options
author | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 20:13:23 +0000 |
---|---|---|
committer | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 20:13:23 +0000 |
commit | c12ecab6d48f359d79312aaae5f535b0f26f8445 (patch) | |
tree | f24c364ea1906bb414d10888ff920feeaa024679 /chrome | |
parent | 28a5e7b166ea0eafa36d7626ad6767a365a7a332 (diff) | |
download | chromium_src-c12ecab6d48f359d79312aaae5f535b0f26f8445.zip chromium_src-c12ecab6d48f359d79312aaae5f535b0f26f8445.tar.gz chromium_src-c12ecab6d48f359d79312aaae5f535b0f26f8445.tar.bz2 |
Add undeclared virtual destructors part 2
Preventative maintainance for abstract classes that do not declare virtual destructors. Base classes that do not declare their destructors as virtual could potentially lead to memory leaks.
r=jar
BUG=47469
Review URL: http://codereview.chromium.org/3032024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/common/deprecated/event_sys.h | 3 | ||||
-rw-r--r-- | chrome/common/mach_message_source_mac.h | 3 | ||||
-rw-r--r-- | chrome/common/sandbox_mac_unittest_helper.h | 2 | ||||
-rw-r--r-- | chrome/installer/util/html_dialog.h | 6 | ||||
-rw-r--r-- | chrome/renderer/pepper_widget.h | 2 | ||||
-rw-r--r-- | chrome/renderer/render_view_visitor.h | 2 | ||||
-rw-r--r-- | chrome/service/cloud_print/job_status_updater.h | 3 | ||||
-rw-r--r-- | chrome/test/interactive_ui/view_event_test_base.h | 2 |
8 files changed, 20 insertions, 3 deletions
diff --git a/chrome/common/deprecated/event_sys.h b/chrome/common/deprecated/event_sys.h index be4264a..6e34eb7 100644 --- a/chrome/common/deprecated/event_sys.h +++ b/chrome/common/deprecated/event_sys.h @@ -20,6 +20,9 @@ template <typename EventType> class EventListener { public: virtual void HandleEvent(const EventType& event) = 0; + + protected: + virtual ~EventListener() {} }; // See the -inl.h for details about the following. diff --git a/chrome/common/mach_message_source_mac.h b/chrome/common/mach_message_source_mac.h index ceced0a..5ad8329 100644 --- a/chrome/common/mach_message_source_mac.h +++ b/chrome/common/mach_message_source_mac.h @@ -39,6 +39,9 @@ class MachMessageSource { class MachPortListener { public: virtual void OnMachMessageReceived(void* mach_msg, size_t size) = 0; + + protected: + virtual ~OnMachMessageReceived() {} }; // |listener| is a week reference passed to CF, it needs to remain in diff --git a/chrome/common/sandbox_mac_unittest_helper.h b/chrome/common/sandbox_mac_unittest_helper.h index adf6401..3edb7c4 100644 --- a/chrome/common/sandbox_mac_unittest_helper.h +++ b/chrome/common/sandbox_mac_unittest_helper.h @@ -70,6 +70,8 @@ class MacSandboxTest : public MultiProcessTest { // REGISTER_SANDBOX_TEST_CASE so it's visible to the test driver. class MacSandboxTestCase { public: + virtual ~MacSandboxTestCase() {} + // Code that runs in the sandboxed subprocess before the sandbox is // initialized. // Returning false from this function will cause the entire test case to fail. diff --git a/chrome/installer/util/html_dialog.h b/chrome/installer/util/html_dialog.h index 325d978..80edbba 100644 --- a/chrome/installer/util/html_dialog.h +++ b/chrome/installer/util/html_dialog.h @@ -39,8 +39,13 @@ class HTMLDialog { // The native window has been created and is about to be visible. Use it // to customize the native |window| appearance. virtual void OnBeforeDisplay(void* window) = 0; + + protected: + virtual ~CustomizationCallback() {} }; + virtual ~HTMLDialog() {} + // Shows the HTML in a modal dialog. The buttons and other UI are also done // in HTML so each native implementation needs to map the user action into // one of the 6 possible results of DialogResult. Important, call this @@ -51,7 +56,6 @@ class HTMLDialog { // If the result of ShowModal() was EXTRA, the information is available // as a string using this method. virtual std::wstring GetExtraResult() = 0; - }; // Factory method for the native HTML Dialog. When done with the object use diff --git a/chrome/renderer/pepper_widget.h b/chrome/renderer/pepper_widget.h index 67d8037..7e0654e 100644 --- a/chrome/renderer/pepper_widget.h +++ b/chrome/renderer/pepper_widget.h @@ -27,7 +27,7 @@ class PepperWidget { virtual void SetProperty(NPWidgetProperty property, void* value) = 0; protected: - ~PepperWidget(); + virtual ~PepperWidget(); // Tells the plugin that a property changed. void WidgetPropertyChanged(NPWidgetProperty property); diff --git a/chrome/renderer/render_view_visitor.h b/chrome/renderer/render_view_visitor.h index 4910b48..5cfb36b 100644 --- a/chrome/renderer/render_view_visitor.h +++ b/chrome/renderer/render_view_visitor.h @@ -12,7 +12,7 @@ class RenderViewVisitor { virtual bool Visit(RenderView* render_view) = 0; protected: - ~RenderViewVisitor() {} + virtual ~RenderViewVisitor() {} }; #endif // CHROME_RENDERER_RENDER_VIEW_VISITOR_H_ diff --git a/chrome/service/cloud_print/job_status_updater.h b/chrome/service/cloud_print/job_status_updater.h index fea4979..993d825 100644 --- a/chrome/service/cloud_print/job_status_updater.h +++ b/chrome/service/cloud_print/job_status_updater.h @@ -27,6 +27,9 @@ class JobStatusUpdater : public base::RefCountedThreadSafe<JobStatusUpdater>, class Delegate { public: virtual bool OnJobCompleted(JobStatusUpdater* updater) = 0; + + protected: + virtual ~Delegate() {} }; JobStatusUpdater(const std::string& printer_name, diff --git a/chrome/test/interactive_ui/view_event_test_base.h b/chrome/test/interactive_ui/view_event_test_base.h index eab30a9..d36fcc5 100644 --- a/chrome/test/interactive_ui/view_event_test_base.h +++ b/chrome/test/interactive_ui/view_event_test_base.h @@ -84,6 +84,8 @@ class ViewEventTestBase : public views::WindowDelegate, static bool ImplementsThreadSafeReferenceCounting() { return false; } protected: + virtual ~ViewEventTestBase() {} + // Returns the view that is added to the window. virtual views::View* CreateContentsView() = 0; |