diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 21:55:59 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 21:55:59 +0000 |
commit | 6eda7a0069682fb113e40c1fdaf8be41fd210b68 (patch) | |
tree | e6818329cde9a17a5b741575ea4fa1b042ab13f9 /chrome/browser/chromeos/system/statistics_provider.cc | |
parent | a033b7b8884885f4a4d696561994bc2312a5ca2a (diff) | |
download | chromium_src-6eda7a0069682fb113e40c1fdaf8be41fd210b68.zip chromium_src-6eda7a0069682fb113e40c1fdaf8be41fd210b68.tar.gz chromium_src-6eda7a0069682fb113e40c1fdaf8be41fd210b68.tar.bz2 |
Move GetNameValuePairsFromFile -> NameValuePairsParser, ERROR -> WARNING
BUG=chromium-os:23551
TEST=chrome://system should still have hardware_class successfully filled in; ERROR in issue should only be a warning
Review URL: http://codereview.chromium.org/8883004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/system/statistics_provider.cc')
-rw-r--r-- | chrome/browser/chromeos/system/statistics_provider.cc | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/chrome/browser/chromeos/system/statistics_provider.cc b/chrome/browser/chromeos/system/statistics_provider.cc index d62add1..3191529 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 |