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

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

Issue 2118473002: 😴 Skip some KeepAlive registrations on shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [more generic anti extension crash check Created 4 years, 5 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/lifetime/scoped_keep_alive.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/chrome_extension_function.cc
diff --git a/chrome/browser/extensions/chrome_extension_function.cc b/chrome/browser/extensions/chrome_extension_function.cc
index 07c3006d98fb9fc4ef3dbebc71d3783fb0ab1e5a..5dab504dce511377347e9006a6598d170274ffad 100644
--- a/chrome/browser/extensions/chrome_extension_function.cc
+++ b/chrome/browser/extensions/chrome_extension_function.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "chrome/browser/extensions/window_controller.h"
#include "chrome/browser/extensions/window_controller_list.h"
@@ -100,6 +101,11 @@ ChromeAsyncExtensionFunction::ChromeAsyncExtensionFunction() {
ChromeAsyncExtensionFunction::~ChromeAsyncExtensionFunction() {}
ExtensionFunction::ResponseAction ChromeAsyncExtensionFunction::Run() {
+ if (g_browser_process->IsShuttingDown()) {
+ error_ = "Shutting down.";
+ return RespondNow(Error(error_));
Peter Beverloo 2016/07/05 12:42:10 Is this potentially developer-visible at this poin
Devlin 2016/07/06 16:54:23 ChromeAsyncExtensionFunction is just one of many E
dgn 2016/07/07 15:20:17 Thanks for the explanation. I'm not too keen on st
Devlin 2016/07/08 01:01:01 If this solves the immediate problem, we can avoid
dgn 2016/07/12 15:58:19 Done. I could not make the check in ExtensionFunct
Devlin 2016/07/12 16:19:38 Instead you can use ExtensionsBrowserClient. We d
dgn 2016/07/13 20:15:08 Oh wow it makes it much simpler indeed. Thanks! I'
+ }
+
return RunAsync() ? RespondLater() : RespondNow(Error(error_));
}
« no previous file with comments | « no previous file | chrome/browser/lifetime/scoped_keep_alive.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698