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

Unified Diff: chrome/browser/extensions/external_install_error.cc

Issue 2885143003: [Extensions] Remove external errors on profile shutdown (Closed)
Patch Set: . Created 3 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 | chrome/browser/extensions/external_install_error_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « no previous file | chrome/browser/extensions/external_install_error_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698