diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-06 04:43:38 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-06 04:43:38 +0000 |
commit | 190d5ab9a765a9ded5aff7f96210a47a937ca649 (patch) | |
tree | c42435ee417773bd466f6e583ef5661edc0a612a | |
parent | 1778cbc87e3366f5b3f51bd69bccb9e98cca316d (diff) | |
download | chromium_src-190d5ab9a765a9ded5aff7f96210a47a937ca649.zip chromium_src-190d5ab9a765a9ded5aff7f96210a47a937ca649.tar.gz chromium_src-190d5ab9a765a9ded5aff7f96210a47a937ca649.tar.bz2 |
Valgrind: Fix leaks in ConstrainedWebDialogDelegate.
BUG=145644
Review URL: https://chromiumcodereview.appspot.com/10920021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155126 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed, 3 insertions, 23 deletions
diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index c943195..4526b16 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -137,7 +137,6 @@ std::string PrintPreviewTabDelegate::GetDialogArgs() const { void PrintPreviewTabDelegate::OnDialogClosed( const std::string& /* json_retval */) { - delete this; } void PrintPreviewTabDelegate::OnCloseContents(WebContents* /* source */, diff --git a/chrome/browser/ui/webui/certificate_viewer_webui.cc b/chrome/browser/ui/webui/certificate_viewer_webui.cc index de31216..f46b65a 100644 --- a/chrome/browser/ui/webui/certificate_viewer_webui.cc +++ b/chrome/browser/ui/webui/certificate_viewer_webui.cc @@ -207,7 +207,6 @@ void CertificateViewerDialog::OnDialogShown( } void CertificateViewerDialog::OnDialogClosed(const std::string& json_retval) { - delete this; } void CertificateViewerDialog::OnCloseContents(WebContents* source, diff --git a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc index c9d9c4d..4b03d5c 100644 --- a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc +++ b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc @@ -56,12 +56,12 @@ ConstrainedWebDialogDelegateBase::~ConstrainedWebDialogDelegateBase() { const WebDialogDelegate* ConstrainedWebDialogDelegateBase::GetWebDialogDelegate() const { - return web_dialog_delegate_; + return web_dialog_delegate_.get(); } WebDialogDelegate* ConstrainedWebDialogDelegateBase::GetWebDialogDelegate() { - return web_dialog_delegate_; + return web_dialog_delegate_.get(); } void ConstrainedWebDialogDelegateBase::OnDialogCloseFromWebUI() { diff --git a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h index 1d87112..ba7ab12 100644 --- a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h +++ b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h @@ -48,7 +48,7 @@ class ConstrainedWebDialogDelegateBase WebDialogWebContentsDelegate* override_tab_delegate); private: - ui::WebDialogDelegate* web_dialog_delegate_; + scoped_ptr<ui::WebDialogDelegate> web_dialog_delegate_; // The constrained window that owns |this|. Saved so we can close it later. ConstrainedWindow* window_; diff --git a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc index 6a2b624..5e6cebb 100644 --- a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc +++ b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc @@ -109,7 +109,6 @@ void TabModalConfirmDialogWebUI::OnDialogClosed( delegate_->Accept(); else delegate_->Cancel(); - delete this; } void TabModalConfirmDialogWebUI::OnCloseContents(WebContents* source, diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt index 4bead1d..4305687 100644 --- a/tools/valgrind/memcheck/suppressions.txt +++ b/tools/valgrind/memcheck/suppressions.txt @@ -5720,14 +5720,6 @@ fun:_ZN7WebCore18StyleSheetContents26requestImportedStyleSheetsEPNS_13CSSStyleSheetE } { - bug_145644a - Memcheck:Leak - fun:_Znw* - fun:_ZN46ConstrainedWebDialogBrowserTest_BasicTest_Test19RunTestOnMainThreadEv - fun:_ZN20InProcessBrowserTest23RunTestOnMainThreadLoopEv - fun:_ZN7content15BrowserTestBase28ProxyRunTestOnMainThreadLoopEv -} -{ bug_145645 Memcheck:Leak fun:malloc @@ -5739,14 +5731,6 @@ fun:_ZN7WebCore25WorkerInspectorControllerC1EPNS_13WorkerContextE } { - bug_145644b - Memcheck:Leak - fun:_Znw* - fun:_ZN68ConstrainedWebDialogBrowserTest_ReleaseTabContentsOnDialogClose_Test19RunTestOnMainThreadEv - fun:_ZN20InProcessBrowserTest23RunTestOnMainThreadLoopEv - fun:_ZN7content15BrowserTestBase28ProxyRunTestOnMainThreadLoopEv -} -{ bug_145650a Memcheck:Leak fun:_Znw* diff --git a/ui/web_dialogs/web_dialog_delegate.h b/ui/web_dialogs/web_dialog_delegate.h index 51fafa2..7cbde25 100644 --- a/ui/web_dialogs/web_dialog_delegate.h +++ b/ui/web_dialogs/web_dialog_delegate.h @@ -117,7 +117,6 @@ class WEB_DIALOGS_EXPORT WebDialogDelegate { // Stores the dialog bounds. virtual void StoreDialogSize(const gfx::Size& dialog_size) {} - protected: virtual ~WebDialogDelegate() {} }; |