Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7465)

Unified Diff: chrome/browser/upgrade_detector_impl.cc

Issue 10683005: Remove two deprecated methods from base::Version (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/about_chrome_view.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « chrome/browser/ui/views/about_chrome_view.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698