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

Unified Diff: chrome/browser/web_applications/web_app_mac.h

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
« no previous file with comments | « chrome/browser/web_applications/web_app_linux.cc ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/web_app_mac.h
diff --git a/chrome/browser/web_applications/web_app_mac.h b/chrome/browser/web_applications/web_app_mac.h
index 49964a300097e6587c354d7e3cb75f76563df761..845907af604c7edaa3cd77df0d9c7d8fa0cbf17c 100644
--- a/chrome/browser/web_applications/web_app_mac.h
+++ b/chrome/browser/web_applications/web_app_mac.h
@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
+#include "base/memory/scoped_ptr.h"
#include "chrome/browser/web_applications/web_app.h"
#include "extensions/common/manifest_handlers/file_handler_info.h"
@@ -30,7 +31,7 @@ namespace web_app {
base::FilePath GetAppInstallPath(const ShortcutInfo& shortcut_info);
// If necessary, launch the shortcut for an app.
-void MaybeLaunchShortcut(const ShortcutInfo& shortcut_info);
+void MaybeLaunchShortcut(scoped_ptr<ShortcutInfo> shortcut_info);
// Rebuild the shortcut and relaunch it.
bool MaybeRebuildShortcut(const base::CommandLine& command_line);
@@ -48,8 +49,10 @@ class WebAppShortcutCreator {
// Creates a new shortcut based on information in |shortcut_info|.
// A copy of the shortcut is placed in |app_data_dir|.
// |chrome_bundle_id| is the CFBundleIdentifier of the Chrome browser bundle.
+ // Retains the pointer |shortcut_info|; the ShortcutInfo object must outlive
+ // the WebAppShortcutCreator.
WebAppShortcutCreator(const base::FilePath& app_data_dir,
- const ShortcutInfo& shortcut_info,
+ const ShortcutInfo* shortcut_info,
const extensions::FileHandlersInfo& file_handlers_info);
virtual ~WebAppShortcutCreator();
@@ -117,8 +120,8 @@ class WebAppShortcutCreator {
// ~/Library/Application Support/Chromium/Default/Web Applications/_crx_abc/
base::FilePath app_data_dir_;
- // Information about the app.
- ShortcutInfo info_;
+ // Information about the app. Owned by the caller of the constructor.
+ const ShortcutInfo* info_;
// The app's file handlers.
extensions::FileHandlersInfo file_handlers_info_;
« no previous file with comments | « chrome/browser/web_applications/web_app_linux.cc ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698