diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 03:16:26 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 03:16:26 +0000 |
commit | 42b0ecedf7eb4beea125ac17ffc0cd373f4b420c (patch) | |
tree | 8c2026442208c18ec14613f0f6132b24acd1e7de /chrome/test/gpu | |
parent | 37a241c6f22e761a07d9ff70aff1b15674eb8bf6 (diff) | |
download | chromium_src-42b0ecedf7eb4beea125ac17ffc0cd373f4b420c.zip chromium_src-42b0ecedf7eb4beea125ac17ffc0cd373f4b420c.tar.gz chromium_src-42b0ecedf7eb4beea125ac17ffc0cd373f4b420c.tar.bz2 |
Infobar system refactor.
This changes the ownership model of infobars so that InfoBars are long-lived and
own their InfoBarDelegates directly. The InfoBarService pseudo-owns the
InfoBars (instead of deleting them directly, it tells them when they're unowned
and expects them to delete themselves).
This fixes leaks when infobars are closed while not visible (e.g. in a
background tab) and in general makes the system clearer and easier to reason
about.
BUG=62154
TEST=none
R=erg@chromium.org, sail@chromium.org, sky@chromium.org
Review URL: https://codereview.chromium.org/22694006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/gpu')
-rw-r--r-- | chrome/test/gpu/webgl_infobar_browsertest.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/test/gpu/webgl_infobar_browsertest.cc b/chrome/test/gpu/webgl_infobar_browsertest.cc index 61721b9..2c458ee 100644 --- a/chrome/test/gpu/webgl_infobar_browsertest.cc +++ b/chrome/test/gpu/webgl_infobar_browsertest.cc @@ -7,6 +7,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/infobars/confirm_infobar_delegate.h" +#include "chrome/browser/infobars/infobar.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" @@ -134,7 +135,7 @@ IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, MAYBE_ContextLossInfoBarReload) { InfoBarService* infobar_service = InfoBarService::FromWebContents( browser()->tab_strip_model()->GetActiveWebContents()); ASSERT_EQ(1u, infobar_service->infobar_count()); - InfoBarDelegate* delegate = infobar_service->infobar_at(0); + InfoBarDelegate* delegate = infobar_service->infobar_at(0)->delegate(); ASSERT_TRUE(delegate->AsThreeDAPIInfoBarDelegate()); delegate->AsConfirmInfoBarDelegate()->Cancel(); |