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

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: Always use short socket path Created 7 years, 1 month 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
« chrome/common/mac/app_mode_common.h ('K') | « chrome/common/mac/app_mode_common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e0333ef2630905870e4d57817f8c97021c86c7ba 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,15 @@ ChromeAppModeInfo::ChromeAppModeInfo()
ChromeAppModeInfo::~ChromeAppModeInfo() {
}
+base::FilePath GetShortSocketPath(const base::FilePath& full_path) {
+ std::string short_path;
+ if (base::Base64Encode(base::SHA1HashString(full_path.value()),
tapted 2013/11/21 11:12:05 under what cases can it return false? I got curio
jackhou1 2013/11/22 00:20:40 Done.
+ &short_path)) {
+ ReplaceChars(short_path, "/", "_", &short_path);
tapted 2013/11/21 11:12:05 I think short_path will have a guaranteed length -
jackhou1 2013/11/22 00:20:40 Done.
+ return base::FilePath("/tmp").Append(short_path);
+ }
+
+ return base::FilePath();
+}
+
} // namespace app_mode
« chrome/common/mac/app_mode_common.h ('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