Index: chrome/browser/web_applications/web_app_win.cc |
diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc |
index 467217fd737637a1158285a4adfe603c4e73abd6..75761db2ffa372e586d6b8dd17b8a52e0dba7eeb 100644 |
--- a/chrome/browser/web_applications/web_app_win.cc |
+++ b/chrome/browser/web_applications/web_app_win.cc |
@@ -336,11 +336,10 @@ void GetShortcutLocationsAndDeleteShortcuts( |
} |
} |
-void CreateIconAndSetRelaunchDetails( |
- const base::FilePath& web_app_path, |
- const base::FilePath& icon_file, |
- std::unique_ptr<web_app::ShortcutInfo> shortcut_info, |
- HWND hwnd) { |
+void CreateIconAndSetRelaunchDetails(const base::FilePath& web_app_path, |
+ const base::FilePath& icon_file, |
+ web_app::ShortcutInfo* shortcut_info, |
+ HWND hwnd) { |
DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
base::CommandLine command_line = |
@@ -376,9 +375,13 @@ void OnShortcutInfoLoadedForSetRelaunchDetails( |
shortcut_info->url); |
base::FilePath icon_file = |
web_app::internals::GetIconFilePath(web_app_path, shortcut_info->title); |
- content::BrowserThread::PostBlockingPoolTask( |
- FROM_HERE, base::Bind(&CreateIconAndSetRelaunchDetails, web_app_path, |
- icon_file, base::Passed(&shortcut_info), hwnd)); |
+ web_app::ShortcutInfo* shortcut_info_ptr = shortcut_info.get(); |
+ content::BrowserThread::PostBlockingPoolTaskAndReply( |
+ FROM_HERE, |
+ base::Bind(&CreateIconAndSetRelaunchDetails, web_app_path, icon_file, |
+ base::Unretained(shortcut_info_ptr), hwnd), |
+ base::Bind(&web_app::internals::DeleteShortcutInfoOnUIThread, |
+ base::Passed(&shortcut_info), base::Closure())); |
} |
} // namespace |
@@ -442,11 +445,10 @@ bool CheckAndSaveIcon(const base::FilePath& icon_file, |
return true; |
} |
-bool CreatePlatformShortcuts( |
- const base::FilePath& web_app_path, |
- std::unique_ptr<ShortcutInfo> shortcut_info, |
- const ShortcutLocations& creation_locations, |
- ShortcutCreationReason creation_reason) { |
+bool CreatePlatformShortcuts(const base::FilePath& web_app_path, |
+ ShortcutInfo* shortcut_info, |
+ const ShortcutLocations& creation_locations, |
+ ShortcutCreationReason creation_reason) { |
DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); |
// Nothing to do on Windows for hidden apps. |
@@ -489,7 +491,7 @@ bool CreatePlatformShortcuts( |
void UpdatePlatformShortcuts(const base::FilePath& web_app_path, |
const base::string16& old_app_title, |
- std::unique_ptr<ShortcutInfo> shortcut_info) { |
+ ShortcutInfo* shortcut_info) { |
DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); |
// Generates file name to use with persisted ico and shortcut file. |
@@ -527,7 +529,7 @@ void UpdatePlatformShortcuts(const base::FilePath& web_app_path, |
} |
void DeletePlatformShortcuts(const base::FilePath& web_app_path, |
- std::unique_ptr<ShortcutInfo> shortcut_info) { |
+ ShortcutInfo* shortcut_info) { |
GetShortcutLocationsAndDeleteShortcuts(web_app_path, |
shortcut_info->profile_path, |
shortcut_info->title, NULL, NULL); |