Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: chrome/browser/ui/metro_pin_tab_helper_win.cc

Issue 11361131: Pass the ImageSkia by pointer instead of by reference, which will create shallow copy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win_aura Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/wallpaper_manager.cc ('k') | ui/gfx/image/image_skia.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/metro_pin_tab_helper_win.cc
diff --git a/chrome/browser/ui/metro_pin_tab_helper_win.cc b/chrome/browser/ui/metro_pin_tab_helper_win.cc
index 0adc88f9e0bcc78988250ef34eae5dbbfed62275..910d82627d118957534f0fe2783bfcca964720a9 100644
--- a/chrome/browser/ui/metro_pin_tab_helper_win.cc
+++ b/chrome/browser/ui/metro_pin_tab_helper_win.cc
@@ -337,7 +337,7 @@ void MetroPinTabHelper::FaviconDownloader::OnDidDownloadFavicon(
// If we don't have a best candidate yet, this is better so just grab it.
if (best_candidate_.isNull()) {
- best_candidate_ = gfx::ImageSkia(*iter).DeepCopy();
+ best_candidate_ = *gfx::ImageSkia(*iter).DeepCopy().get();
continue;
}
@@ -348,7 +348,7 @@ void MetroPinTabHelper::FaviconDownloader::OnDidDownloadFavicon(
}
// Othewise it is our new best candidate.
- best_candidate_ = gfx::ImageSkia(*iter).DeepCopy();
+ best_candidate_ = *gfx::ImageSkia(*iter).DeepCopy().get();
}
}
@@ -395,11 +395,12 @@ void MetroPinTabHelper::TogglePinnedToStartScreen() {
GURL url = web_contents()->GetURL();
string16 url_str = UTF8ToUTF16(url.spec());
string16 title = web_contents()->GetTitle();
+ // TODO(oshima): Use scoped_ptr::Pass to pass it to other thread.
gfx::ImageSkia favicon;
FaviconTabHelper* favicon_tab_helper = FaviconTabHelper::FromWebContents(
web_contents());
if (favicon_tab_helper->FaviconIsValid())
- favicon = favicon_tab_helper->GetFavicon().AsImageSkia().DeepCopy();
+ favicon = *favicon_tab_helper->GetFavicon().AsImageSkia().DeepCopy().get();
favicon_downloader_.reset(new FaviconDownloader(this, title, url_str,
favicon));
« no previous file with comments | « chrome/browser/chromeos/login/wallpaper_manager.cc ('k') | ui/gfx/image/image_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698