Index: chrome/browser/extensions/external_install_error.cc |
diff --git a/chrome/browser/extensions/external_install_error.cc b/chrome/browser/extensions/external_install_error.cc |
index 7165b6f4f4bf1745f9a38da0f82bba47bd96ee62..8d86557728ad5af7e5e9f0949ce1abb2ba39d861 100644 |
--- a/chrome/browser/extensions/external_install_error.cc |
+++ b/chrome/browser/extensions/external_install_error.cc |
@@ -28,6 +28,7 @@ |
#include "chrome/browser/ui/global_error/global_error_service_factory.h" |
#include "chrome/browser/ui/tabs/tab_strip_model.h" |
#include "chrome/grit/generated_resources.h" |
+#include "components/keyed_service/content/browser_context_dependency_manager.h" |
#include "content/public/browser/storage_partition.h" |
#include "extensions/browser/extension_registry.h" |
#include "extensions/browser/extension_system.h" |
@@ -312,6 +313,12 @@ ExternalInstallError::ExternalInstallError( |
} |
ExternalInstallError::~ExternalInstallError() { |
+#if DCHECK_IS_ON() |
Finnur
2017/05/17 16:15:11
Why the #if check?
Devlin
2017/05/17 16:17:26
Just to avoid the production cost. Since we shoul
|
+ // Errors should only be removed while the profile is valid, since removing |
+ // the error can trigger other subsystems listening for changes. |
+ BrowserContextDependencyManager::GetInstance() |
+ ->AssertBrowserContextWasntDestroyed(browser_context_); |
+#endif |
if (global_error_.get()) |
error_service_->RemoveUnownedGlobalError(global_error_.get()); |
} |