Commit 7a018261 authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Improve ReturnsValidPath() diagnostics

When ReturnsValidPath() fails it just returned false, with no indication
as to which of the several checks was the issue. This adds printing of
specifics, including the path when applicable. This will help with
future failures and with an ongoing investigation.

Bug: 1053446
Change-Id: I8071df44b20af482a0387e2f8558d878de6d05b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2065358Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743366}
parent 7e8202b8
...@@ -45,14 +45,30 @@ bool ReturnsValidPath(int dir_type) { ...@@ -45,14 +45,30 @@ bool ReturnsValidPath(int dir_type) {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
if (dir_type != DIR_EXE && dir_type != DIR_MODULE && dir_type != FILE_EXE && if (dir_type != DIR_EXE && dir_type != DIR_MODULE && dir_type != FILE_EXE &&
dir_type != FILE_MODULE) { dir_type != FILE_MODULE) {
if (path.ReferencesParent()) if (path.ReferencesParent()) {
LOG(INFO) << "Path (" << path << ") references parent.";
return false; return false;
}
} }
#else #else
if (path.ReferencesParent()) if (path.ReferencesParent()) {
LOG(INFO) << "Path (" << path << ") references parent.";
return false; return false;
}
#endif #endif
return result && !path.empty() && (!check_path_exists || PathExists(path)); if (!result) {
LOG(INFO) << "PathService::Get() returned false.";
return false;
}
if (path.empty()) {
LOG(INFO) << "PathService::Get() returned an empty path.";
return false;
}
if (check_path_exists && !PathExists(path)) {
LOG(INFO) << "Path (" << path << ") does not exist.";
return false;
}
return true;
} }
#if defined(OS_WIN) #if defined(OS_WIN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment