Index: chrome/browser/upgrade_detector_impl.cc |
diff --git a/chrome/browser/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector_impl.cc |
index fb81f96c2ef9f7a850f504c8dfc871fdef4c6080..570275e391ba59c8452c3de6d6861f7f4ead8e04 100644 |
--- a/chrome/browser/upgrade_detector_impl.cc |
+++ b/chrome/browser/upgrade_detector_impl.cc |
@@ -76,8 +76,8 @@ void DetectUpgradeTask(const base::Closure& upgrade_detected_task, |
bool* is_critical_upgrade) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
- scoped_ptr<Version> installed_version; |
- scoped_ptr<Version> critical_update; |
+ Version installed_version; |
+ Version critical_update; |
#if defined(OS_WIN) |
// Get the version of the currently *installed* instance of Chrome, |
@@ -95,17 +95,15 @@ void DetectUpgradeTask(const base::Closure& upgrade_detected_task, |
// TODO(tommi): Check if using the default distribution is always the right |
// thing to do. |
BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
- installed_version.reset(InstallUtil::GetChromeVersion(dist, |
- system_install)); |
+ InstallUtil::GetChromeVersion(dist, system_install, &installed_version); |
- if (installed_version.get()) { |
- critical_update.reset( |
- InstallUtil::GetCriticalUpdateVersion(dist, system_install)); |
+ if (installed_version.IsValid()) { |
+ InstallUtil::GetCriticalUpdateVersion(dist, system_install, |
+ &critical_update); |
} |
#elif defined(OS_MACOSX) |
- installed_version.reset( |
- Version::GetVersionFromString(UTF16ToASCII( |
- keystone_glue::CurrentlyInstalledVersion()))); |
+ installed_version = |
+ Version(UTF16ToASCII(keystone_glue::CurrentlyInstalledVersion())); |
#elif defined(OS_POSIX) |
// POSIX but not Mac OS X: Linux, etc. |
CommandLine command_line(*CommandLine::ForCurrentProcess()); |
@@ -116,7 +114,7 @@ void DetectUpgradeTask(const base::Closure& upgrade_detected_task, |
return; |
} |
- installed_version.reset(Version::GetVersionFromString(reply)); |
+ installed_version = Version(reply); |
#endif |
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
@@ -129,23 +127,22 @@ void DetectUpgradeTask(const base::Closure& upgrade_detected_task, |
NOTREACHED() << "Failed to get current file version"; |
return; |
} |
- scoped_ptr<Version> running_version( |
- Version::GetVersionFromString(version_info.Version())); |
- if (running_version.get() == NULL) { |
- NOTREACHED() << "Failed to parse version info"; |
+ Version running_version(version_info.Version()); |
+ if (!running_version.IsValid()) { |
+ NOTREACHED(); |
return; |
} |
// |installed_version| may be NULL when the user downgrades on Linux (by |
// switching from dev to beta channel, for example). The user needs a |
// restart in this case as well. See http://crbug.com/46547 |
- if (!installed_version.get() || |
- (installed_version->CompareTo(*running_version) > 0)) { |
+ if (!installed_version.IsValid() || |
+ (installed_version.CompareTo(running_version) > 0)) { |
// If a more recent version is available, it might be that we are lacking |
// a critical update, such as a zero-day fix. |
*is_critical_upgrade = |
- critical_update.get() && |
- (critical_update->CompareTo(*running_version) > 0); |
+ critical_update.IsValid() && |
+ (critical_update.CompareTo(running_version) > 0); |
// Fire off the upgrade detected task. |
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |