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

Unified Diff: base/at_exit.cc

Issue 2309153002: Remove RenderThreadImpl::Shutdown (Closed)
Patch Set: temp Created 3 years, 11 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
Index: base/at_exit.cc
diff --git a/base/at_exit.cc b/base/at_exit.cc
index cfe4cf9a587cc3da54e0ec3bc693e860beec425c..06203e8cf9944acad01e7259722ffa8fbc98b8ca 100644
--- a/base/at_exit.cc
+++ b/base/at_exit.cc
@@ -22,6 +22,8 @@ namespace base {
// this for thread-safe access, since it will only be modified in testing.
static AtExitManager* g_top_manager = NULL;
+static bool g_disable_managers = false;
+
AtExitManager::AtExitManager()
: processing_callbacks_(false), next_manager_(g_top_manager) {
// If multiple modules instantiate AtExitManagers they'll end up living in this
@@ -80,7 +82,8 @@ void AtExitManager::ProcessCallbacksNow() {
while (!tasks.empty()) {
base::Closure task = tasks.top();
- task.Run();
+ if (!g_disable_managers)
+ task.Run();
tasks.pop();
}
@@ -88,6 +91,11 @@ void AtExitManager::ProcessCallbacksNow() {
DCHECK(g_top_manager->stack_.empty());
}
+void AtExitManager::DisableAllAtExitManagers() {
+ AutoLock lock(g_top_manager->lock_);
+ g_disable_managers = true;
+}
+
AtExitManager::AtExitManager(bool shadow)
: processing_callbacks_(false), next_manager_(g_top_manager) {
DCHECK(shadow || !g_top_manager);
« no previous file with comments | « base/at_exit.h ('k') | content/child/child_process.cc » ('j') | content/child/child_process.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698