diff options
author | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 23:42:43 +0000 |
---|---|---|
committer | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 23:42:43 +0000 |
commit | 8e4f010318e8ee028b22a2e8f5d4276a93054950 (patch) | |
tree | e0eee580f0f66dce4f55e45efdc0a76dcb1ac26b | |
parent | 9a9787ed17dce85531063d1fb2a07ce801c58de5 (diff) | |
download | chromium_src-8e4f010318e8ee028b22a2e8f5d4276a93054950.zip chromium_src-8e4f010318e8ee028b22a2e8f5d4276a93054950.tar.gz chromium_src-8e4f010318e8ee028b22a2e8f5d4276a93054950.tar.bz2 |
Add undeclared virtual destructors part 4
Preventative maintenance 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.
These files were discovered using the -Wnon-virtual-dtor flag in g++.
r=jar
BUG=47469
Review URL: http://codereview.chromium.org/3032046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54408 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/common/net/url_fetcher.h | 6 | ||||
-rw-r--r-- | chrome/common/web_database_observer_impl.h | 1 | ||||
-rw-r--r-- | chrome/renderer/notification_provider.h | 2 | ||||
-rw-r--r-- | chrome/renderer/pepper_plugin_delegate_impl.h | 1 | ||||
-rw-r--r-- | chrome/renderer/renderer_webcookiejar_impl.h | 1 | ||||
-rw-r--r-- | chrome/renderer/websharedworkerrepository_impl.h | 3 | ||||
-rw-r--r-- | chrome/service/cloud_print/job_status_updater.h | 2 | ||||
-rw-r--r-- | chrome/service/cloud_print/print_system.h | 6 | ||||
-rw-r--r-- | chrome/service/cloud_print/printer_job_handler.h | 3 | ||||
-rw-r--r-- | chrome/test/sync/engine/mock_connection_manager.h | 6 | ||||
-rw-r--r-- | chrome/test/test_launcher/test_runner.h | 3 | ||||
-rw-r--r-- | chrome/worker/webworkerclient_proxy.h | 2 |
12 files changed, 34 insertions, 2 deletions
diff --git a/chrome/common/net/url_fetcher.h b/chrome/common/net/url_fetcher.h index 4671ae0..79234ca 100644 --- a/chrome/common/net/url_fetcher.h +++ b/chrome/common/net/url_fetcher.h @@ -74,6 +74,9 @@ class URLFetcher { int response_code, const ResponseCookies& cookies, const std::string& data) = 0; + + protected: + virtual ~Delegate() {} }; // URLFetcher::Create uses the currently registered Factory to create the @@ -84,6 +87,9 @@ class URLFetcher { const GURL& url, RequestType request_type, Delegate* d) = 0; + + protected: + virtual ~Factory() {} }; // |url| is the URL to send the request to. diff --git a/chrome/common/web_database_observer_impl.h b/chrome/common/web_database_observer_impl.h index dced3df..84101c8 100644 --- a/chrome/common/web_database_observer_impl.h +++ b/chrome/common/web_database_observer_impl.h @@ -13,6 +13,7 @@ class WebDatabaseObserverImpl : public WebKit::WebDatabaseObserver { public: explicit WebDatabaseObserverImpl(IPC::Message::Sender* sender); + virtual ~WebDatabaseObserverImpl() {} virtual void databaseOpened(const WebKit::WebDatabase& database); virtual void databaseModified(const WebKit::WebDatabase& database); virtual void databaseClosed(const WebKit::WebDatabase& database); diff --git a/chrome/renderer/notification_provider.h b/chrome/renderer/notification_provider.h index aa1d8f6..80ec832 100644 --- a/chrome/renderer/notification_provider.h +++ b/chrome/renderer/notification_provider.h @@ -23,7 +23,7 @@ class WebNotificationPermissionCallback; class NotificationProvider : public WebKit::WebNotificationPresenter { public: explicit NotificationProvider(RenderView* view); - ~NotificationProvider() {} + virtual ~NotificationProvider() {} // WebKit::WebNotificationPresenter interface. virtual bool show(const WebKit::WebNotification& proxy); diff --git a/chrome/renderer/pepper_plugin_delegate_impl.h b/chrome/renderer/pepper_plugin_delegate_impl.h index 5b208e9..fa9fa91 100644 --- a/chrome/renderer/pepper_plugin_delegate_impl.h +++ b/chrome/renderer/pepper_plugin_delegate_impl.h @@ -24,6 +24,7 @@ class PepperPluginDelegateImpl public base::SupportsWeakPtr<PepperPluginDelegateImpl> { public: explicit PepperPluginDelegateImpl(RenderView* render_view); + virtual ~PepperPluginDelegateImpl() {} // Called by RenderView to tell us about painting events, these two functions // just correspond to the DidInitiatePaint and DidFlushPaint in R.V.. diff --git a/chrome/renderer/renderer_webcookiejar_impl.h b/chrome/renderer/renderer_webcookiejar_impl.h index f8fee08..f004bed 100644 --- a/chrome/renderer/renderer_webcookiejar_impl.h +++ b/chrome/renderer/renderer_webcookiejar_impl.h @@ -20,6 +20,7 @@ class RendererWebCookieJarImpl : public WebKit::WebCookieJar { explicit RendererWebCookieJarImpl(IPC::Message::Sender* sender) : sender_(sender) { } + virtual ~RendererWebCookieJarImpl() {} private: // WebKit::WebCookieJar methods: diff --git a/chrome/renderer/websharedworkerrepository_impl.h b/chrome/renderer/websharedworkerrepository_impl.h index 7183171..745c094 100644 --- a/chrome/renderer/websharedworkerrepository_impl.h +++ b/chrome/renderer/websharedworkerrepository_impl.h @@ -16,12 +16,15 @@ namespace WebKit { class WebSharedWorkerRepositoryImpl : public WebKit::WebSharedWorkerRepository { public: + virtual ~WebSharedWorkerRepositoryImpl() {} + virtual void addSharedWorker(WebKit::WebSharedWorker*, DocumentID document); virtual void documentDetached(DocumentID document); // Returns true if the document has created a SharedWorker (used by the // WebKit code to determine if the document can be suspended). virtual bool hasSharedWorkers(DocumentID document); + private: // The set of documents that have created a SharedWorker. typedef base::hash_set<DocumentID> DocumentSet; diff --git a/chrome/service/cloud_print/job_status_updater.h b/chrome/service/cloud_print/job_status_updater.h index 993d825..c03b04e 100644 --- a/chrome/service/cloud_print/job_status_updater.h +++ b/chrome/service/cloud_print/job_status_updater.h @@ -39,6 +39,7 @@ class JobStatusUpdater : public base::RefCountedThreadSafe<JobStatusUpdater>, const GURL& cloud_print_server_url, cloud_print::PrintSystem* print_system, Delegate* delegate); + virtual ~JobStatusUpdater() {} // Checks the status of the local print job and sends an update. void UpdateStatus(); void Stop(); @@ -48,6 +49,7 @@ class JobStatusUpdater : public base::RefCountedThreadSafe<JobStatusUpdater>, int response_code, const ResponseCookies& cookies, const std::string& data); + private: std::string printer_name_; std::string job_id_; diff --git a/chrome/service/cloud_print/print_system.h b/chrome/service/cloud_print/print_system.h index 6a36f9a..586e672 100644 --- a/chrome/service/cloud_print/print_system.h +++ b/chrome/service/cloud_print/print_system.h @@ -90,6 +90,9 @@ class PrintSystem : public base::RefCountedThreadSafe<PrintSystem> { public: virtual void OnPrinterAdded() = 0; // TODO(gene): Do we need OnPrinterDeleted notification here? + + protected: + virtual ~Delegate() {} }; virtual ~PrintServerWatcher() {} @@ -105,6 +108,9 @@ class PrintSystem : public base::RefCountedThreadSafe<PrintSystem> { virtual void OnPrinterDeleted() = 0; virtual void OnPrinterChanged() = 0; virtual void OnJobChanged() = 0; + + protected: + virtual ~Delegate() {} }; virtual ~PrinterWatcher() {} diff --git a/chrome/service/cloud_print/printer_job_handler.h b/chrome/service/cloud_print/printer_job_handler.h index f1c3ed4..08d4d76 100644 --- a/chrome/service/cloud_print/printer_job_handler.h +++ b/chrome/service/cloud_print/printer_job_handler.h @@ -91,6 +91,9 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, public: virtual void OnPrinterJobHandlerShutdown( PrinterJobHandler* job_handler, const std::string& printer_id) = 0; + + protected: + virtual ~Delegate() {} }; // Begin public interface diff --git a/chrome/test/sync/engine/mock_connection_manager.h b/chrome/test/sync/engine/mock_connection_manager.h index 685624f..858d6f0e 100644 --- a/chrome/test/sync/engine/mock_connection_manager.h +++ b/chrome/test/sync/engine/mock_connection_manager.h @@ -32,6 +32,9 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager { class MidCommitObserver { public: virtual void Observe() = 0; + + protected: + virtual ~MidCommitObserver() {} }; MockConnectionManager(syncable::DirectoryManager* dirmgr, @@ -133,6 +136,9 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager { public: // Called with response_code_override_lock_ acquired. virtual void OnOverrideComplete() = 0; + + protected: + virtual ~ResponseCodeOverrideRequestor() {} }; void ThrottleNextRequest(ResponseCodeOverrideRequestor* visitor); void FailWithAuthInvalid(ResponseCodeOverrideRequestor* visitor); diff --git a/chrome/test/test_launcher/test_runner.h b/chrome/test/test_launcher/test_runner.h index 07524b1..3dee047 100644 --- a/chrome/test/test_launcher/test_runner.h +++ b/chrome/test/test_launcher/test_runner.h @@ -46,6 +46,9 @@ class TestRunner { class TestRunnerFactory { public: virtual TestRunner* CreateTestRunner() const = 0; + + protected: + virtual ~TestRunnerFactory() {} }; } // namespace diff --git a/chrome/worker/webworkerclient_proxy.h b/chrome/worker/webworkerclient_proxy.h index 29cdb00..07fd655 100644 --- a/chrome/worker/webworkerclient_proxy.h +++ b/chrome/worker/webworkerclient_proxy.h @@ -30,7 +30,7 @@ class WebWorkerStubBase; class WebWorkerClientProxy : public WebKit::WebWorkerClient { public: WebWorkerClientProxy(int route_id, WebWorkerStubBase* stub); - ~WebWorkerClientProxy(); + virtual ~WebWorkerClientProxy(); // WebWorkerClient implementation. virtual void postMessageToWorkerObject( |