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

Unified Diff: base/base_paths.cc

Issue 159833003: Add support for GetHomeDir for Mac and Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 10 months 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
« no previous file with comments | « base/base_paths.h ('k') | base/base_paths_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base_paths.cc
diff --git a/base/base_paths.cc b/base/base_paths.cc
index b4fc28b6c75daabbacce8cbed9e33a2ff792ef40..1b99e850758890c4f05ea95ade3bcb7c48d01bf8 100644
--- a/base/base_paths.cc
+++ b/base/base_paths.cc
@@ -13,35 +13,34 @@ namespace base {
bool PathProvider(int key, FilePath* result) {
// NOTE: DIR_CURRENT is a special case in PathService::Get
- FilePath cur;
switch (key) {
case DIR_EXE:
- PathService::Get(FILE_EXE, &cur);
- cur = cur.DirName();
- break;
+ PathService::Get(FILE_EXE, result);
+ *result = result->DirName();
+ return true;
case DIR_MODULE:
- PathService::Get(FILE_MODULE, &cur);
- cur = cur.DirName();
- break;
+ PathService::Get(FILE_MODULE, result);
+ *result = result->DirName();
+ return true;
case DIR_TEMP:
- if (!base::GetTempDir(&cur))
+ if (!GetTempDir(result))
return false;
- break;
+ return true;
+ case base::DIR_HOME:
+ *result = GetHomeDir();
+ return true;
case DIR_TEST_DATA:
- if (!PathService::Get(DIR_SOURCE_ROOT, &cur))
+ if (!PathService::Get(DIR_SOURCE_ROOT, result))
return false;
- cur = cur.Append(FILE_PATH_LITERAL("base"));
- cur = cur.Append(FILE_PATH_LITERAL("test"));
- cur = cur.Append(FILE_PATH_LITERAL("data"));
- if (!base::PathExists(cur)) // We don't want to create this.
+ *result = result->Append(FILE_PATH_LITERAL("base"));
+ *result = result->Append(FILE_PATH_LITERAL("test"));
+ *result = result->Append(FILE_PATH_LITERAL("data"));
+ if (!PathExists(*result)) // We don't want to create this.
return false;
- break;
+ return true;
default:
return false;
}
-
- *result = cur;
- return true;
}
} // namespace base
« no previous file with comments | « base/base_paths.h ('k') | base/base_paths_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698