From a0a1c5a43129c46aec7525f0292ebe17434b77e6 Mon Sep 17 00:00:00 2001 From: "stevenjb@chromium.org" Date: Thu, 26 Sep 2013 21:51:23 +0000 Subject: 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 --- chrome/browser/chromeos/external_metrics.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'chrome/browser/chromeos/external_metrics.cc') 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; -- cgit v1.1