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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/mac/app_mode_common.h" 5 #include "chrome/common/mac/app_mode_common.h"
6 6
7 #include "base/base64.h"
8 #include "base/sha1.h"
9 #include "base/strings/string_util.h"
10
7 namespace app_mode { 11 namespace app_mode {
8 12
9 const char kAppShimSocketName[] = "App Shim Socket"; 13 const char kAppShimSocketName[] = "App Shim Socket";
10 14
11 const char kAppListModeId[] = "app_list"; 15 const char kAppListModeId[] = "app_list";
12 16
13 const char kLaunchedByChromeProcessId[] = "launched-by-chrome-process-id"; 17 const char kLaunchedByChromeProcessId[] = "launched-by-chrome-process-id";
14 18
15 NSString* const kCFBundleDisplayNameKey = @"CFBundleDisplayName"; 19 NSString* const kCFBundleDisplayNameKey = @"CFBundleDisplayName";
16 NSString* const kLSHasLocalizedDisplayNameKey = @"LSHasLocalizedDisplayName"; 20 NSString* const kLSHasLocalizedDisplayNameKey = @"LSHasLocalizedDisplayName";
(...skipping 16 matching lines...) Expand all
33 ChromeAppModeInfo::ChromeAppModeInfo() 37 ChromeAppModeInfo::ChromeAppModeInfo()
34 : major_version(0), 38 : major_version(0),
35 minor_version(0), 39 minor_version(0),
36 argc(0), 40 argc(0),
37 argv(0) { 41 argv(0) {
38 } 42 }
39 43
40 ChromeAppModeInfo::~ChromeAppModeInfo() { 44 ChromeAppModeInfo::~ChromeAppModeInfo() {
41 } 45 }
42 46
47 base::FilePath GetShortSocketPath(const base::FilePath& user_data_dir) {
48 std::string udd_hash;
49 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
50 &udd_hash)) {
51 base::ReplaceChars(udd_hash, "/", "_", &udd_hash);
52 DCHECK_EQ(28u, udd_hash.length());
53 return base::FilePath("/tmp")
54 .Append("chrome-" + udd_hash)
55 .Append(kAppShimSocketName);
56 }
57
58 NOTREACHED();
59 return base::FilePath();
60 }
61
43 } // namespace app_mode 62 } // namespace app_mode
OLDNEW
« 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