summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/external_metrics.cc
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 21:51:23 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 21:51:23 +0000
commita0a1c5a43129c46aec7525f0292ebe17434b77e6 (patch)
tree089aef99bd9338ad9a30a9ba358f85cbe7ae8e2e /chrome/browser/chromeos/external_metrics.cc
parent3d3b931e213b1a972233465055c8aae1f1044f75 (diff)
downloadchromium_src-a0a1c5a43129c46aec7525f0292ebe17434b77e6.zip
chromium_src-a0a1c5a43129c46aec7525f0292ebe17434b77e6.tar.gz
chromium_src-a0a1c5a43129c46aec7525f0292ebe17434b77e6.tar.bz2
Parse /etc/lsb-release only once on ChromeOS
This moves all parsing and caching of the contents of /etc/lsb-release to base::SysInfo. This eliminates redundant parsing from: * LsbReleaseLogSource * VersionLoader * StatisticsProvider BUG=266903 For chrome_main_deleagate.cc (code removal only) R=brettw@chromium.org, derat@chromium.org, pneubeck@chromium.org, xiyuan@chromium.org TBR=cpu@chromium.org Review URL: https://codereview.chromium.org/23588009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/external_metrics.cc')
-rw-r--r--chrome/browser/chromeos/external_metrics.cc11
1 files changed, 1 insertions, 10 deletions
diff --git a/chrome/browser/chromeos/external_metrics.cc b/chrome/browser/chromeos/external_metrics.cc
index b0ae298..55d0d3b 100644
--- a/chrome/browser/chromeos/external_metrics.cc
+++ b/chrome/browser/chromeos/external_metrics.cc
@@ -97,17 +97,8 @@ void SetupProgressiveScanFieldTrial() {
}
// Finds out if we're on a 2GB Parrot.
-//
-// This code reads and parses /etc/lsb-release. There are at least four other
-// places that open and parse /etc/lsb-release, and I wish I could fix the
-// mess. At least this code is temporary.
-
bool Is2GBParrot() {
- base::FilePath path("/etc/lsb-release");
- std::string contents;
- if (!base::ReadFileToString(path, &contents))
- return false;
- if (contents.find("CHROMEOS_RELEASE_BOARD=parrot") == std::string::npos)
+ if (base::SysInfo::GetLsbReleaseBoard() != "parrot")
return false;
// There are 2GB and 4GB models.
return base::SysInfo::AmountOfPhysicalMemory() <= 2LL * 1024 * 1024 * 1024;