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

Unified Diff: base/message_loop/message_loop.h

Issue 2395763004: Disable MessageLoop features on some BrowserThreads. (Closed)
Patch Set: rebase Created 4 years, 2 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 | base/message_loop/message_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.h
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h
index 4f3250c3b7f1b164d984dc0e4dcee28866092015..1b8351ba9498675e6e9d2e2120d5dda4cfb02cb0 100644
--- a/base/message_loop/message_loop.h
+++ b/base/message_loop/message_loop.h
@@ -316,6 +316,15 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// Runs the specified PendingTask.
void RunTask(const PendingTask& pending_task);
+ // Disables running nested loops and Add/RemoveNestingObserver().
+ void DisableNesting() { enable_nesting_ = false; }
+
+ // Disables Add/RemoveDestructionObserver().
+ void DisableDestructionObservers() { enable_destruction_observers_ = false; }
+
+ // Disables Add/RemoveTaskObserver().
+ void DisableTaskObservers() { enable_task_observers_ = false; }
+
//----------------------------------------------------------------------------
protected:
std::unique_ptr<MessagePump> pump_;
@@ -451,6 +460,15 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// MessageLoop is bound to its thread and constant forever after.
PlatformThreadId thread_id_;
+ // Enable running nested loops and Add/RemoveNestingObserver().
+ bool enable_nesting_ = true;
+
+ // Enable Add/RemoveDestructionObserver().
+ bool enable_destruction_observers_ = true;
+
+ // Enable Add/RemoveTaskObserver().
+ bool enable_task_observers_ = true;
+
DISALLOW_COPY_AND_ASSIGN(MessageLoop);
};
« no previous file with comments | « no previous file | base/message_loop/message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698