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

Unified Diff: chrome/browser/chromeos/system/name_value_pairs_parser.cc

Issue 8883004: Move GetNameValuePairsFromFile -> NameValuePairsParser, ERROR -> WARNING (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/system/name_value_pairs_parser.cc
diff --git a/chrome/browser/chromeos/system/name_value_pairs_parser.cc b/chrome/browser/chromeos/system/name_value_pairs_parser.cc
index 4b326592546f6015e631f16a4855e420621fffca..51ee327d20a1b562f15f58c45138c68cf7c4b405 100644
--- a/chrome/browser/chromeos/system/name_value_pairs_parser.cc
+++ b/chrome/browser/chromeos/system/name_value_pairs_parser.cc
@@ -72,14 +72,14 @@ bool NameValuePairsParser::GetSingleValueFromTool(int argc,
DCHECK_GE(argc, 1);
if (!file_util::PathExists(FilePath(argv[0]))) {
- LOG(ERROR) << argv[0] << " not found";
+ LOG(WARNING) << "Tool for statistics not found: " << argv[0];
return false;
}
CommandLine command_line(argc, argv);
std::string output_string;
if (!base::GetAppOutput(command_line, &output_string)) {
- LOG(ERROR) << "Error executing: " << command_line.GetCommandLineString();
+ LOG(WARNING) << "Error executing: " << command_line.GetCommandLineString();
return false;
}
TrimWhitespaceASCII(output_string, TRIM_ALL, &output_string);
@@ -87,5 +87,16 @@ bool NameValuePairsParser::GetSingleValueFromTool(int argc,
return true;
}
+void NameValuePairsParser::GetNameValuePairsFromFile(const FilePath& file_path,
+ const std::string& eq,
+ const std::string& delim) {
+ std::string contents;
+ if (file_util::ReadFileToString(file_path, &contents)) {
+ ParseNameValuePairs(contents, eq, delim);
+ } else {
+ LOG(WARNING) << "Unable to read statistics file: " << file_path.value();
+ }
+}
+
} // namespace system
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/system/name_value_pairs_parser.h ('k') | chrome/browser/chromeos/system/statistics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698