Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_LSB_RELEASE_LOG_SOURCE_H_ | |
| 5 #define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_LSB_RELEASE_LOG_SOURCE_H_ | |
| 6 | |
| 7 #include "chrome/browser/chromeos/system_logs/system_logs_fetcher.h" | |
| 8 | |
| 9 namespace chromeos { | |
| 10 | |
| 11 // Fetches release information form /etc/lsb-release file. | |
| 12 class LsbReleaseLogSource : public SystemLogsSource { | |
| 13 public: | |
| 14 LsbReleaseLogSource() {} | |
| 15 virtual ~LsbReleaseLogSource() {} | |
| 16 | |
| 17 // SystemLogsSource override. | |
| 18 virtual void Fetch(const SysLogsSourceCallback& callback) OVERRIDE; | |
| 19 | |
| 20 // For testing. Parses a key=value pairs from a string. There can be only one | |
| 21 // pair per line and the value must confine to a single line. | |
| 22 // Example: | |
| 23 // foo = 1 | |
| 24 // bar = 2 | |
| 25 // Note: it automatically strips whitespaces from the front and back of values | |
| 26 // and keys. | |
| 27 static void ParseLSBRelease(const std::string& lsb_data, | |
| 28 SystemLogsResponse* response); | |
| 29 | |
| 30 private: | |
| 31 // Gets the info from the /etc/lsb-release and parses it | |
| 32 static void ReadLSBRelease(SystemLogsResponse* response); | |
|
Lei Zhang
2012/08/21 19:56:55
Put this in an anonymous namespace instead and rem
rkc1
2012/08/21 20:02:33
This has been discussed extensively; it really doe
Lei Zhang
2012/08/21 20:08:15
Which I did not read given the number of iteration
| |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(LsbReleaseLogSource); | |
| 35 }; | |
| 36 | |
| 37 } // namespace chromeos | |
| 38 | |
| 39 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_LSB_RELEASE_LOG_SOURCE_H_ | |
| OLD | NEW |