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

Unified Diff: services/ui/service.cc

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() 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
Index: services/ui/service.cc
diff --git a/services/ui/service.cc b/services/ui/service.cc
index c3fbf99c7c15aad92f6971650e670b929d469f2c..673110cd2f27522009655a1d21d6adaed28af637 100644
--- a/services/ui/service.cc
+++ b/services/ui/service.cc
@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
+#include "base/run_loop.h"
#include "base/threading/platform_thread.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
@@ -268,10 +269,8 @@ void Service::OnFirstDisplayReady() {
void Service::OnNoMoreDisplays() {
// We may get here from the destructor, in which case there is no messageloop.
- if (base::MessageLoop::current() &&
- base::MessageLoop::current()->is_running()) {
+ if (base::RunLoop::IsRunningOnCurrentThread())
base::MessageLoop::current()->QuitWhenIdle();
- }
}
bool Service::IsTestConfig() const {

Powered by Google App Engine
This is Rietveld 408576698