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

Unified Diff: chrome/browser/chromeos/system/statistics_provider.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
« no previous file with comments | « chrome/browser/chromeos/system/name_value_pairs_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/system/statistics_provider.cc
diff --git a/chrome/browser/chromeos/system/statistics_provider.cc b/chrome/browser/chromeos/system/statistics_provider.cc
index d62add1367811cbd46d0abe736f064ece4ab81c0..319152942188b3b13f2e67d0b050365e4ea5225b 100644
--- a/chrome/browser/chromeos/system/statistics_provider.cc
+++ b/chrome/browser/chromeos/system/statistics_provider.cc
@@ -50,17 +50,6 @@ const char kVpdDelim[] = "\n";
// Timeout that we should wait for statistics to get loaded
const int kTimeoutSecs = 3;
-// Gets name-value paris from the file using the parser.
-void GetNameValuePairsFromFile(NameValuePairsParser* parser,
- const FilePath& file_path,
- const std::string& eq,
- const std::string& delim) {
- std::string contents;
- if (file_util::ReadFileToString(file_path, &contents)) {
- parser->ParseNameValuePairs(contents, eq, delim);
- }
-}
-
} // namespace
// The StatisticsProvider implementation used in production.
@@ -142,15 +131,13 @@ void StatisticsProviderImpl::LoadMachineStatistics() {
// Use kUnknownHardwareClass if the hardware class command fails.
parser.AddNameValuePair(kHardwareClassKey, kUnknownHardwareClass);
}
- GetNameValuePairsFromFile(&parser,
- FilePath(kMachineHardwareInfoFile),
- kMachineHardwareInfoEq,
- kMachineHardwareInfoDelim);
- GetNameValuePairsFromFile(&parser,
- FilePath(kMachineOSInfoFile),
- kMachineOSInfoEq,
- kMachineOSInfoDelim);
- GetNameValuePairsFromFile(&parser, FilePath(kVpdFile), kVpdEq, kVpdDelim);
+ parser.GetNameValuePairsFromFile(FilePath(kMachineHardwareInfoFile),
+ kMachineHardwareInfoEq,
+ kMachineHardwareInfoDelim);
+ parser.GetNameValuePairsFromFile(FilePath(kMachineOSInfoFile),
+ kMachineOSInfoEq,
+ kMachineOSInfoDelim);
+ parser.GetNameValuePairsFromFile(FilePath(kVpdFile), kVpdEq, kVpdDelim);
#if defined(GOOGLE_CHROME_BUILD)
// TODO(kochi): This is for providing a channel information to
« no previous file with comments | « chrome/browser/chromeos/system/name_value_pairs_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698