diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-27 03:41:47 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-27 03:41:47 +0000 |
commit | 91a99fd999110df1e9275a842616df7904356b30 (patch) | |
tree | ed3c705c0cbde2fe8e523e4fd4b588bc9fd9ea4b /chrome/browser/browser_theme_provider.cc | |
parent | 238a21d057719470eb2b7189beb2c9dafc43dde1 (diff) | |
download | chromium_src-91a99fd999110df1e9275a842616df7904356b30.zip chromium_src-91a99fd999110df1e9275a842616df7904356b30.tar.gz chromium_src-91a99fd999110df1e9275a842616df7904356b30.tar.bz2 |
Reverting 19447.
This was causing interactive ui tests to fail with a crash:
kernel32.dll!_InterlockedDecrement@4()
> interactive_ui_tests.exe!sk_atomic_dec() Line 40 C++
interactive_ui_tests.exe!SkBitmap::MipMap::unref() Line 76 C++
interactive_ui_tests.exe!SkBitmap::freeMipMap() Line 367 C++
interactive_ui_tests.exe!SkBitmap::freePixels() Line 346 C++
interactive_ui_tests.exe!SkBitmap::~SkBitmap() Line 100 C++
interactive_ui_tests.exe!SkBitmap::`scalar deleting destructor'() C++
interactive_ui_tests.exe!BrowserThemeProvider::FreeImages() Line 744 C++
interactive_ui_tests.exe!BrowserThemeProvider::~BrowserThemeProvider() Line 141 C++
interactive_ui_tests.exe!BrowserThemeProvider::`scalar deleting destructor'() C++
interactive_ui_tests.exe!base::RefCounted<BrowserThemeProvider>::Release() Line 80 C++
interactive_ui_tests.exe!scoped_refptr<BrowserThemeProvider>::operator=() Line 209 C++
interactive_ui_tests.exe!ProfileImpl::~ProfileImpl() Line 584 C++
interactive_ui_tests.exe!ProfileImpl::`scalar deleting destructor'() C++
interactive_ui_tests.exe!ProfileManager::~ProfileManager() Line 57 C++
interactive_ui_tests.exe!ProfileManager::`scalar deleting destructor'() C++
interactive_ui_tests.exe!scoped_ptr<ProfileManager>::reset() Line 81 C++
interactive_ui_tests.exe!BrowserProcessImpl::~BrowserProcessImpl() Line 164 C++
interactive_ui_tests.exe!BrowserProcessImpl::`scalar deleting destructor'() C++
interactive_ui_tests.exe!browser_shutdown::Shutdown() Line 135 C++
interactive_ui_tests.exe!BrowserMain() Line 826 C++
interactive_ui_tests.exe!InProcessBrowserTest::SetUp() Line 129 C++
interactive_ui_tests.exe!testing::Test::Run() Line 2021 C++
interactive_ui_tests.exe!testing::internal::TestInfoImpl::Run() Line 2291 C++
interactive_ui_tests.exe!testing::internal::TestInfoImpl::RunTest() Line 656 C++
Review URL: http://codereview.chromium.org/147259
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider.cc')
-rw-r--r-- | chrome/browser/browser_theme_provider.cc | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc index c5aeed9..e88d019 100644 --- a/chrome/browser/browser_theme_provider.cc +++ b/chrome/browser/browser_theme_provider.cc @@ -166,7 +166,7 @@ SkBitmap* BrowserThemeProvider::GetBitmapNamed(int id) { // If we still don't have an image, load it from resourcebundle. if (!result.get()) - result.reset(new SkBitmap(*rb_.GetBitmapNamed(id))); + result.reset(rb_.GetBitmapNamed(id)); if (result.get()) { // If the requested image is part of the toolbar button set, and we have @@ -566,7 +566,7 @@ void BrowserThemeProvider::GenerateFrameImages() { std::map<const int, int>::iterator iter = frame_tints_.begin(); while (iter != frame_tints_.end()) { int id = iter->first; - scoped_ptr<SkBitmap> frame; + SkBitmap* frame; // If there's no frame image provided for the specified id, then load // the default provided frame. If that's not provided, skip this whole // thing and just use the default images. @@ -575,18 +575,18 @@ void BrowserThemeProvider::GenerateFrameImages() { IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME; if (images_.find(id) != images_.end()) { - frame.reset(LoadThemeBitmap(id)); + frame = LoadThemeBitmap(id); } else if (base_id != id && images_.find(base_id) != images_.end()) { - frame.reset(LoadThemeBitmap(base_id)); + frame = LoadThemeBitmap(base_id); } else { // If the theme doesn't specify an image, then apply the tint to // the default frame. Note that the default theme provides default // bitmaps for all frame types, so this isn't strictly necessary // in the case where no tint is provided either. - frame.reset(new SkBitmap(*rb_.GetBitmapNamed(IDR_THEME_FRAME))); + frame = rb_.GetBitmapNamed(IDR_THEME_FRAME); } - if (frame.get()) { + if (frame) { SkBitmap* tinted = new SkBitmap(TintBitmap(*frame, iter->second)); image_cache_[id] = tinted; } @@ -738,11 +738,6 @@ void BrowserThemeProvider::FreeImages() { delete *i; } generated_images_.clear(); - - for (ImageCache::iterator i = image_cache_.begin(); - i != image_cache_.end(); i++) { - delete i->second; - } image_cache_.clear(); } |