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

Unified Diff: chrome/browser/web_applications/update_shortcut_worker_win.cc

Issue 1771033003: gfx::Image: Added thread checker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove UpdateShortcutWorker changes; instead just disable thread checking. Created 3 years, 5 months 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/themes/browser_theme_pack.cc ('k') | chrome/browser/web_applications/web_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/update_shortcut_worker_win.cc
diff --git a/chrome/browser/web_applications/update_shortcut_worker_win.cc b/chrome/browser/web_applications/update_shortcut_worker_win.cc
index 9d3ae82e31c0af696a6d777e72b06e2e171d38fb..2c91af53b41866ea48a38c0a91a1915798a34f33 100644
--- a/chrome/browser/web_applications/update_shortcut_worker_win.cc
+++ b/chrome/browser/web_applications/update_shortcut_worker_win.cc
@@ -86,6 +86,10 @@ void UpdateShortcutWorker::DownloadIcon() {
if (unprocessed_icons_.empty()) {
// No app icon. Just use the favicon from WebContents.
+ // TODO(mgiuca): This Image is passed to the FILE thread while still being
+ // used on the UI thread. This is not thread-safe and needs to be fixed.
+ // Remove this thread-check disable. https://crbug.com/596348.
+ shortcut_info_->favicon.DisableThreadChecking();
UpdateShortcuts();
return;
}
@@ -130,7 +134,10 @@ void UpdateShortcutWorker::DidDownloadFavicon(
if (!bitmap.isNull()) {
// Update icon with download image and update shortcut.
- shortcut_info_->favicon.Add(gfx::Image::CreateFrom1xBitmap(bitmap));
+ gfx::Image icon = gfx::Image::CreateFrom1xBitmap(bitmap);
+ // |icon| will be used on the FILE thread, so detach it from this thread.
+ icon.DetachFromThread();
+ shortcut_info_->favicon.Add(icon);
extensions::TabHelper* extensions_tab_helper =
extensions::TabHelper::FromWebContents(web_contents_);
extensions_tab_helper->SetAppIcon(bitmap);
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | chrome/browser/web_applications/web_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698