Revert 69592 - file_version_info was not finding Mac values correctly.
Changed file_version_info to find Mac values, and changed version_info to fail if values can't be found.
BUG=NONE
TEST=BUILD
Review URL: http://codereview.chromium.org/5815001
[email protected]
Review URL: http://codereview.chromium.org/6017003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69601 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome_frame/metrics_service.cc b/chrome_frame/metrics_service.cc
index 1ca8caa8..d82e16b 100644
--- a/chrome_frame/metrics_service.cc
+++ b/chrome_frame/metrics_service.cc
@@ -608,11 +608,17 @@
// static
std::string MetricsService::GetVersionString() {
chrome::VersionInfo version_info;
- std::string version = version_info.Version();
- // Add the -F extensions to ensure that UMA data uploaded by ChromeFrame
- // lands in the ChromeFrame bucket.
- version += "-F";
- if (!version_info.IsOfficialBuild())
- version.append("-devel");
- return version;
+ if (version_info.is_valid()) {
+ std::string version = version_info.Version();
+ // Add the -F extensions to ensure that UMA data uploaded by ChromeFrame
+ // lands in the ChromeFrame bucket.
+ version += "-F";
+ if (!version_info.IsOfficialBuild())
+ version.append("-devel");
+ return version;
+ } else {
+ NOTREACHED() << "Unable to retrieve version string.";
+ }
+
+ return std::string();
}