Chromium Code Reviews| 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); |