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

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: Remove nit. 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..b5baa2ebf9426d0b90852e1b8d50efd00b45ee51 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1997,12 +1997,14 @@ 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);
// Other than for unpacked extensions, CrxInstaller should have guaranteed
// that we aren't downgrading.
- if (!Manifest::IsUnpackedLocation(extension->location()))
+ if (!Manifest::IsUnpackedLocation(extension->location())) {
CHECK_GE(extension->version()->CompareTo(*(old->version())), 0);
+ is_extension_upgrade =
+ extension->version()->CompareTo(*(old->version())) > 0;
+ }
asargent_no_longer_on_chrome 2013/07/29 23:09:01 I think this block would read a little better writ
zhchbin 2013/07/30 01:46:41 Note that here is *CHECK_GE*. And is_extension_upg
}
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