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

Unified Diff: chrome/browser/ui/app_list/app_list_service_mac.mm

Issue 1038573002: Fixed thread-unsafe use of gfx::Image in app shortcut creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 8 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
Index: chrome/browser/ui/app_list/app_list_service_mac.mm
diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm
index d65553a3ece13c3cba737dccaeb93231ad47bf35..f33787952a5cf644c7bc20e3b115a7bff42d029e 100644
--- a/chrome/browser/ui/app_list/app_list_service_mac.mm
+++ b/chrome/browser/ui/app_list/app_list_service_mac.mm
@@ -86,20 +86,21 @@ const NSTimeInterval kAnimationDuration = 0.2;
// Distance towards the screen edge that the app list moves from when showing.
const CGFloat kDistanceMovedOnShow = 20;
-web_app::ShortcutInfo GetAppListShortcutInfo(
+scoped_ptr<web_app::ShortcutInfo> GetAppListShortcutInfo(
const base::FilePath& profile_path) {
- web_app::ShortcutInfo shortcut_info;
+ scoped_ptr<web_app::ShortcutInfo> shortcut_info(new web_app::ShortcutInfo);
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
if (channel == chrome::VersionInfo::CHANNEL_CANARY) {
- shortcut_info.title =
+ shortcut_info->title =
l10n_util::GetStringUTF16(IDS_APP_LIST_SHORTCUT_NAME_CANARY);
} else {
- shortcut_info.title = l10n_util::GetStringUTF16(IDS_APP_LIST_SHORTCUT_NAME);
+ shortcut_info->title =
+ l10n_util::GetStringUTF16(IDS_APP_LIST_SHORTCUT_NAME);
}
- shortcut_info.extension_id = app_mode::kAppListModeId;
- shortcut_info.description = shortcut_info.title;
- shortcut_info.profile_path = profile_path;
+ shortcut_info->extension_id = app_mode::kAppListModeId;
+ shortcut_info->description = shortcut_info->title;
+ shortcut_info->profile_path = profile_path;
return shortcut_info;
}
@@ -107,32 +108,32 @@ web_app::ShortcutInfo GetAppListShortcutInfo(
void CreateAppListShim(const base::FilePath& profile_path) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
WebApplicationInfo web_app_info;
- web_app::ShortcutInfo shortcut_info =
+ scoped_ptr<web_app::ShortcutInfo> shortcut_info =
GetAppListShortcutInfo(profile_path);
ResourceBundle& resource_bundle = ResourceBundle::GetSharedInstance();
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
if (channel == chrome::VersionInfo::CHANNEL_CANARY) {
#if defined(GOOGLE_CHROME_BUILD)
- shortcut_info.favicon.Add(
+ shortcut_info->favicon.Add(
*resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_16));
- shortcut_info.favicon.Add(
+ shortcut_info->favicon.Add(
*resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_32));
- shortcut_info.favicon.Add(
+ shortcut_info->favicon.Add(
*resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_128));
- shortcut_info.favicon.Add(
+ shortcut_info->favicon.Add(
*resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_256));
#else
NOTREACHED();
#endif
} else {
- shortcut_info.favicon.Add(
+ shortcut_info->favicon.Add(
*resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_16));
- shortcut_info.favicon.Add(
+ shortcut_info->favicon.Add(
*resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_32));
- shortcut_info.favicon.Add(
+ shortcut_info->favicon.Add(
*resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_128));
- shortcut_info.favicon.Add(
+ shortcut_info->favicon.Add(
*resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_256));
}
@@ -148,7 +149,7 @@ void CreateAppListShim(const base::FilePath& profile_path) {
if (installed_version == 0)
shortcut_locations.in_quick_launch_bar = true;
- web_app::CreateNonAppShortcut(shortcut_locations, shortcut_info);
+ web_app::CreateNonAppShortcut(shortcut_locations, shortcut_info.Pass());
local_state->SetInteger(prefs::kAppLauncherShortcutVersion,
kShortcutVersion);
« no previous file with comments | « chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm ('k') | chrome/browser/ui/app_list/app_list_view_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698