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

Unified Diff: base/base_paths_posix.cc

Issue 8585029: Make GetWebKitRootDirFilePath smarter about where the WebKit root is relative to the chromium root (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 years, 11 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 | « no previous file | base/base_paths_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base_paths_posix.cc
diff --git a/base/base_paths_posix.cc b/base/base_paths_posix.cc
index 14d17d638171de2212fe73c49af32a3afda02e26..bfb1d07bf49b68da22da1f76ded086c12a890983 100644
--- a/base/base_paths_posix.cc
+++ b/base/base_paths_posix.cc
@@ -29,10 +29,6 @@ namespace base {
const char kSelfExe[] = "/proc/self/exe";
#endif
-// The name of this file relative to the source root. This is used for checking
-// that the source checkout is in the correct place.
-static const char kThisSourceFile[] = "base/base_paths_posix.cc";
-
bool PathProviderPosix(int key, FilePath* result) {
FilePath path;
switch (key) {
@@ -84,40 +80,21 @@ bool PathProviderPosix(int key, FilePath* result) {
std::string cr_source_root;
if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) {
path = FilePath(cr_source_root);
- if (file_util::PathExists(path.Append(kThisSourceFile))) {
+ if (file_util::PathExists(path)) {
*result = path;
return true;
} else {
DLOG(WARNING) << "CR_SOURCE_ROOT is set, but it appears to not "
- << "point to the correct source root directory.";
+ << "point to a directory.";
}
}
// On POSIX, unit tests execute two levels deep from the source root.
// For example: out/{Debug|Release}/net_unittest
if (PathService::Get(base::DIR_EXE, &path)) {
- path = path.DirName().DirName();
- if (file_util::PathExists(path.Append(kThisSourceFile))) {
- *result = path;
- return true;
- }
- }
- // In a case of WebKit-only checkout, executable files are put into
- // <root of checkout>/out/{Debug|Release}, and we should return
- // <root of checkout>/Source/WebKit/chromium for DIR_SOURCE_ROOT.
- if (PathService::Get(base::DIR_EXE, &path)) {
- path = path.DirName().DirName().Append("Source/WebKit/chromium");
- if (file_util::PathExists(path.Append(kThisSourceFile))) {
- *result = path;
- return true;
- }
- }
- // If that failed (maybe the build output is symlinked to a different
- // drive) try assuming the current directory is the source root.
- if (file_util::GetCurrentDirectory(&path) &&
- file_util::PathExists(path.Append(kThisSourceFile))) {
- *result = path;
+ *result = path.DirName().DirName();
return true;
}
+
DLOG(ERROR) << "Couldn't find your source root. "
<< "Try running from your chromium/src directory.";
return false;
« no previous file with comments | « no previous file | base/base_paths_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698