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

Side by Side Diff: base/base_paths_mac.mm

Issue 5344003: Revert 67191 - chrome_paths: refactor and sanitize cache directory handling... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/base_paths_linux.cc ('k') | base/path_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/base_paths_mac.h" 5 #include "base/base_paths_mac.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <mach-o/dyld.h> 8 #include <mach-o/dyld.h>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 29 matching lines...) Expand all
40 } // namespace 40 } // namespace
41 41
42 namespace base { 42 namespace base {
43 43
44 bool PathProviderMac(int key, FilePath* result) { 44 bool PathProviderMac(int key, FilePath* result) {
45 switch (key) { 45 switch (key) {
46 case base::FILE_EXE: 46 case base::FILE_EXE:
47 case base::FILE_MODULE: { 47 case base::FILE_MODULE: {
48 return GetNSExecutablePath(result); 48 return GetNSExecutablePath(result);
49 } 49 }
50 case base::DIR_CACHE: 50 case base::DIR_USER_CACHE:
51 return mac_util::GetUserDirectory(NSCachesDirectory, result); 51 return mac_util::GetUserDirectory(NSCachesDirectory, result);
52 case base::DIR_APP_DATA: 52 case base::DIR_APP_DATA:
53 return mac_util::GetUserDirectory(NSApplicationSupportDirectory, result); 53 return mac_util::GetUserDirectory(NSApplicationSupportDirectory, result);
54 case base::DIR_SOURCE_ROOT: { 54 case base::DIR_SOURCE_ROOT: {
55 // Go through PathService to catch overrides. 55 // Go through PathService to catch overrides.
56 if (PathService::Get(base::FILE_EXE, result)) { 56 if (PathService::Get(base::FILE_EXE, result)) {
57 // Start with the executable's directory. 57 // Start with the executable's directory.
58 *result = result->DirName(); 58 *result = result->DirName();
59 if (mac_util::AmIBundled()) { 59 if (mac_util::AmIBundled()) {
60 // The bundled app executables (Chromium, TestShell, etc) live five 60 // The bundled app executables (Chromium, TestShell, etc) live five
61 // levels down, eg: 61 // levels down, eg:
62 // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium 62 // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium
63 *result = result->DirName().DirName().DirName().DirName().DirName(); 63 *result = result->DirName().DirName().DirName().DirName().DirName();
64 } else { 64 } else {
65 // Unit tests execute two levels deep from the source root, eg: 65 // Unit tests execute two levels deep from the source root, eg:
66 // src/xcodebuild/{Debug|Release}/base_unittests 66 // src/xcodebuild/{Debug|Release}/base_unittests
67 *result = result->DirName().DirName(); 67 *result = result->DirName().DirName();
68 } 68 }
69 } 69 }
70 return true; 70 return true;
71 } 71 }
72 default: 72 default:
73 return false; 73 return false;
74 } 74 }
75 } 75 }
76 76
77 } // namespace base 77 } // namespace base
OLDNEW
« no previous file with comments | « base/base_paths_linux.cc ('k') | base/path_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698