diff options
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/metrics_service.cc | 20 | ||||
-rw-r--r-- | chrome_frame/renderer_glue.cc | 11 |
2 files changed, 18 insertions, 13 deletions
diff --git a/chrome_frame/metrics_service.cc b/chrome_frame/metrics_service.cc index 1ca8caa..d82e16b 100644 --- a/chrome_frame/metrics_service.cc +++ b/chrome_frame/metrics_service.cc @@ -608,11 +608,17 @@ bool MetricsService::UploadData() { // 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(); } diff --git a/chrome_frame/renderer_glue.cc b/chrome_frame/renderer_glue.cc index 3e973bc..8980e97 100644 --- a/chrome_frame/renderer_glue.cc +++ b/chrome_frame/renderer_glue.cc @@ -2,9 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/file_version_info.h" -#include "base/scoped_ptr.h" -#include "base/string_util.h" +#include "chrome/common/chrome_version_info.h" namespace webkit_glue { @@ -12,11 +10,12 @@ namespace webkit_glue { // here instead of pulling in the whole renderer lib where this function // is implemented for Chrome. std::string GetProductVersion() { - scoped_ptr<FileVersionInfo> info( - FileVersionInfo::CreateFileVersionInfoForCurrentModule()); + chrome::VersionInfo version_info; std::string product("Chrome/"); - product += info.get() ? WideToASCII(info->product_version()) : "0.0.0.0"; + product += version_info.is_valid() ? version_info.Version() + : "0.0.0.0"; return product; } } // end namespace webkit_glue + |