| Index: chrome/browser/extensions/extension_disabled_ui.cc
|
| diff --git a/chrome/browser/extensions/extension_disabled_ui.cc b/chrome/browser/extensions/extension_disabled_ui.cc
|
| index acad8cecc8c32a30d4d4127a43f421f3b388a507..508c6fa894d5572298d40b66b31db60e2ee835b2 100644
|
| --- a/chrome/browser/extensions/extension_disabled_ui.cc
|
| +++ b/chrome/browser/extensions/extension_disabled_ui.cc
|
| @@ -360,13 +360,14 @@ void ExtensionDisabledGlobalError::OnShutdown(
|
| }
|
|
|
| void ExtensionDisabledGlobalError::RemoveGlobalError() {
|
| - GlobalErrorServiceFactory::GetForProfile(service_->profile())
|
| - ->RemoveGlobalError(this);
|
| + std::unique_ptr<GlobalError> ptr =
|
| + GlobalErrorServiceFactory::GetForProfile(service_->profile())
|
| + ->RemoveGlobalError(this);
|
| registrar_.RemoveAll();
|
| registry_observer_.RemoveAll();
|
| // Delete this object after any running tasks, so that the extension dialog
|
| // still has it as a delegate to finish the current tasks.
|
| - base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
|
| + base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, ptr.release());
|
| }
|
|
|
| // Globals --------------------------------------------------------------------
|
| @@ -382,7 +383,7 @@ void AddExtensionDisabledErrorWithIcon(base::WeakPtr<ExtensionService> service,
|
| const Extension* extension = service->GetInstalledExtension(extension_id);
|
| if (extension) {
|
| GlobalErrorServiceFactory::GetForProfile(service->profile())
|
| - ->AddGlobalError(new ExtensionDisabledGlobalError(
|
| + ->AddGlobalError(base::MakeUnique<ExtensionDisabledGlobalError>(
|
| service.get(), extension, is_remote_install, icon));
|
| }
|
| }
|
|
|