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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 20909002: Correct the flag: is_extension_upgrade, which denote whether the extension is being upgrading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better readability. Created 7 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 5829a47b5f8c0f6e947b7878ecd302e859cced62..4587dcd8b3972170b4e7508aa5293a26563e8ba6 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1996,13 +1996,16 @@ void ExtensionService::AddExtension(const Extension* extension) {
}
bool is_extension_upgrade = false;
- if (const Extension* old = GetInstalledExtension(extension->id())) {
- is_extension_upgrade = true;
- DCHECK_NE(extension, old);
zhchbin 2013/07/30 01:53:56 As my comment, this DCHECK_NE make no sense becaus
+ const Extension* old = GetInstalledExtension(extension->id());
+ if (old) {
// Other than for unpacked extensions, CrxInstaller should have guaranteed
// that we aren't downgrading.
- if (!Manifest::IsUnpackedLocation(extension->location()))
- CHECK_GE(extension->version()->CompareTo(*(old->version())), 0);
+ if (!Manifest::IsUnpackedLocation(extension->location())) {
+ int version_compare_result =
+ extension->version()->CompareTo(*(old->version()));
+ is_extension_upgrade = version_compare_result > 0;
+ CHECK_GE(version_compare_result, 0);
+ }
}
SetBeingUpgraded(extension, is_extension_upgrade);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698