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

Unified Diff: extensions/shell/browser/shell_content_browser_client.cc

Issue 2749823002: Restore KeyedServiceFactory diagnostics for context use-after-destroy. (Closed)
Patch Set: Refactor SiteEngagementService tests. Created 3 years, 9 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 | « extensions/browser/process_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/browser/shell_content_browser_client.cc
diff --git a/extensions/shell/browser/shell_content_browser_client.cc b/extensions/shell/browser/shell_content_browser_client.cc
index 49482621dc2794ca8592ca6d185decef39c14571..76ae196be64cba3f61231205e151a7485ea7a5e2 100644
--- a/extensions/shell/browser/shell_content_browser_client.cc
+++ b/extensions/shell/browser/shell_content_browser_client.cc
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "components/guest_view/browser/guest_view_message_filter.h"
+#include "content/public/browser/browser_main_runner.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/site_instance.h"
@@ -179,6 +180,10 @@ void ShellContentBrowserClient::SiteInstanceGotProcess(
void ShellContentBrowserClient::SiteInstanceDeleting(
content::SiteInstance* site_instance) {
+ // Don't do anything if we're shutting down.
+ if (content::BrowserMainRunner::ExitedMainMessageLoop())
+ return;
+
// If this isn't an extension renderer there's nothing to do.
const Extension* extension = GetExtension(site_instance);
if (!extension)
« no previous file with comments | « extensions/browser/process_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698