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

Unified Diff: chrome/browser/extensions/api/management/management_api.cc

Issue 282133008: Don't crash when two extension uninstall prompts are shown at the same time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/api/management/management_api.cc
diff --git a/chrome/browser/extensions/api/management/management_api.cc b/chrome/browser/extensions/api/management/management_api.cc
index 86f67ef9684dfffc23e434167800577d11766a4e..fa6a0ffd5c0cc6b5de5566a9d54a15b324fb5692 100644
--- a/chrome/browser/extensions/api/management/management_api.cc
+++ b/chrome/browser/extensions/api/management/management_api.cc
@@ -580,13 +580,22 @@ void ManagementUninstallFunctionBase::SetAutoConfirmForTest(
void ManagementUninstallFunctionBase::Finish(bool should_uninstall) {
if (should_uninstall) {
- bool success = service()->UninstallExtension(
- extension_id_,
- false, /* external uninstall */
- NULL);
+ // The extension can be uninstalled in another window while the UI was
+ // showing. Do nothing in that case.
not at google - send to devlin 2014/05/16 22:11:00 Do we have any tests which actually exercise the U
Marijn Kruisselbrink 2014/05/16 22:19:12 I think in tests we bypass the dialog, and behave
+ ExtensionRegistry* registry = ExtensionRegistry::Get(GetProfile());
+ const Extension* extension = registry->GetExtensionById(
+ extension_id_, ExtensionRegistry::EVERYTHING);
+ if (!extension) {
not at google - send to devlin 2014/05/16 22:11:00 emulate the extension not being there by using kNo
Marijn Kruisselbrink 2014/05/16 22:19:12 Done.
+ SendResponse(false);
+ } else {
+ bool success =
+ service()->UninstallExtension(extension_id_,
not at google - send to devlin 2014/05/16 22:11:00 what kind of behaviour do we have in ExtensionServ
Marijn Kruisselbrink 2014/05/16 22:19:12 It is a CHECK failure already.
+ false, /* external uninstall */
+ NULL);
- // TODO set error_ if !success
- SendResponse(success);
+ // TODO set error_ if !success
+ SendResponse(success);
+ }
} else {
error_ = ErrorUtils::FormatErrorMessage(
keys::kUninstallCanceledError, extension_id_);
« 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