Remove two deprecated methods from base::Version
BUG=none
TEST=none
[email protected]
Review URL: https://chromiumcodereview.appspot.com/10683005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146157 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector_impl.cc
index fb81f96..570275e3 100644
--- a/chrome/browser/upgrade_detector_impl.cc
+++ b/chrome/browser/upgrade_detector_impl.cc
@@ -76,8 +76,8 @@
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 @@
// 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 @@
return;
}
- installed_version.reset(Version::GetVersionFromString(reply));
+ installed_version = Version(reply);
#endif
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
@@ -129,23 +127,22 @@
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,