| 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..0af762c67daab3b56d9b6966109d39f711e2a3e1 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()),
|
| + &udd_hash)) {
|
| + 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
|
|
|