From b31dbaf51d30c2a37db28874e60724d66050eb97 Mon Sep 17 00:00:00 2001 From: "oshima@chromium.org" Date: Mon, 10 Sep 2012 20:47:10 +0000 Subject: Fix leaks in ash_unittests also suppressed leaks in non chrome component plus a couple of cleanups (eliminated unused code/variables) BUG=144990,146947 TEST=valgrind reports no leak on ash_unittests Review URL: https://chromiumcodereview.appspot.com/10907101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155819 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/test/test_shell_delegate.cc | 3 ++- ash/test/test_shell_delegate.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'ash/test') diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc index 36e61e8..9496ccf 100644 --- a/ash/test/test_shell_delegate.cc +++ b/ash/test/test_shell_delegate.cc @@ -80,7 +80,8 @@ void TestShellDelegate::ShowTaskManager() { } content::BrowserContext* TestShellDelegate::GetCurrentBrowserContext() { - return new content::TestBrowserContext(); + current_browser_context_.reset(new content::TestBrowserContext()); + return current_browser_context_.get(); } void TestShellDelegate::ToggleSpokenFeedback() { diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h index e464d8f..76e80bb 100644 --- a/ash/test/test_shell_delegate.h +++ b/ash/test/test_shell_delegate.h @@ -7,6 +7,7 @@ #include "ash/shell_delegate.h" #include "base/compiler_specific.h" +#include "base/memory/scoped_ptr.h" namespace ash { namespace test { @@ -53,6 +54,7 @@ class TestShellDelegate : public ShellDelegate { private: bool locked_; bool spoken_feedback_enabled_; + scoped_ptr current_browser_context_; DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); }; -- cgit v1.1