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

Unified Diff: content/browser/browser_main_runner.cc

Issue 2810763002: gpu: Do not relaunch the process during teardown. (Closed)
Patch Set: AtomicFlag Created 3 years, 8 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 | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_runner.cc
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc
index 4b3c19c4aa7b7c90b8615594eaafb386078783ad..0d986c057b7be1c05486d300d46e34d3cb6e8aef 100644
--- a/content/browser/browser_main_runner.cc
+++ b/content/browser/browser_main_runner.cc
@@ -44,7 +44,7 @@ namespace content {
namespace {
-bool g_exited_main_message_loop = false;
+base::LazyInstance<base::AtomicFlag>::Leaky g_exited_main_message_loop;
const char kMainThreadName[] = "CrBrowserMain";
} // namespace
@@ -195,7 +195,7 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
{
// The trace event has to stay between profiler creation and destruction.
TRACE_EVENT0("shutdown", "BrowserMainRunner");
- g_exited_main_message_loop = true;
+ g_exited_main_message_loop.Get().Set();
main_loop_->ShutdownThreadsAndCleanUp();
@@ -242,7 +242,8 @@ BrowserMainRunner* BrowserMainRunner::Create() {
// static
bool BrowserMainRunner::ExitedMainMessageLoop() {
- return g_exited_main_message_loop;
+ return !(g_exited_main_message_loop == nullptr) &&
+ g_exited_main_message_loop.Get().IsSet();
}
} // namespace content
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698