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

Unified Diff: chrome/common/mac/app_mode_common.mm

Issue 66043003: Put app shim IPC socket in a temporary directory. (Mac) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years 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/common/mac/app_mode_common.mm
diff --git a/chrome/common/mac/app_mode_common.mm b/chrome/common/mac/app_mode_common.mm
index 317dec3b6331e32aa8ae332f02d4c4d9b74708f8..35ec523443cc2c6e769ac78bfb9ac11d5a52b9f6 100644
--- a/chrome/common/mac/app_mode_common.mm
+++ b/chrome/common/mac/app_mode_common.mm
@@ -4,6 +4,10 @@
#include "chrome/common/mac/app_mode_common.h"
+#include "base/base64.h"
+#include "base/sha1.h"
+#include "base/strings/string_util.h"
+
namespace app_mode {
const char kAppShimSocketName[] = "App Shim Socket";
@@ -40,4 +44,19 @@ ChromeAppModeInfo::ChromeAppModeInfo()
ChromeAppModeInfo::~ChromeAppModeInfo() {
}
+base::FilePath GetShortSocketPath(const base::FilePath& user_data_dir) {
+ std::string udd_hash;
+ if (base::Base64Encode(base::SHA1HashString(user_data_dir.value()),
palmer 2013/12/10 20:04:23 A cryptographic hash of a predictable input is sti
jackhou1 2014/01/06 05:29:52 The new implementation no longer requires it to be
+ &udd_hash)) {
+ base::ReplaceChars(udd_hash, "/", "_", &udd_hash);
+ DCHECK_EQ(28u, udd_hash.length());
+ return base::FilePath("/tmp")
+ .Append("chrome-" + udd_hash)
+ .Append(kAppShimSocketName);
+ }
+
+ NOTREACHED();
+ return base::FilePath();
+}
+
} // namespace app_mode
« apps/app_shim/chrome_main_app_mode_mac.mm ('K') | « chrome/common/mac/app_mode_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698