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

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, 9 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..b41a04692a7b85ee1a75e1cd698a667e002609e8 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,6 +49,8 @@ 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 a reference to |shortcut_info|; the ShortcutInfo object must
+ // outlive the WebAppShortcutCreator.
benwells 2015/04/01 02:01:33 This is unfortunate. Do you need much info from th
Matt Giuca 2015/04/01 03:31:47 Well, you do need |favicon|, which is the reason i
Matt Giuca 2015/04/01 03:54:26 As discussed, not doing this.
WebAppShortcutCreator(const base::FilePath& app_data_dir,
const ShortcutInfo& shortcut_info,
const extensions::FileHandlersInfo& file_handlers_info);
@@ -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_;
benwells 2015/04/01 02:01:33 Maybe it would be better to use a raw pointer here
Matt Giuca 2015/04/01 03:31:47 OK, I'll do that if you agree that we should still
Matt Giuca 2015/04/01 03:54:26 Done.
// 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