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

Unified Diff: base/message_loop/message_loop.h

Issue 2419803002: Disallow task observers on some BrowserThreads. (Closed)
Patch Set: 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 8388f59da6d0ab1ea67f99ca4a0ceb8c30e0e269..34aa835d6672bb47cb9228cc1f4b78343fbdc4e5 100644
--- a/base/message_loop/message_loop.h
+++ b/base/message_loop/message_loop.h
@@ -320,6 +320,10 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// Add/RemoveNestingObserver() on this MessageLoop will crash.
void DisallowNesting() { allow_nesting_ = false; }
+ // Disallow task observers. After this is called, calling
+ // Add/RemoveTaskObserver() on this MessageLoop will crash.
+ void DisallowTaskObservers() { allow_task_observers_ = false; }
+
//----------------------------------------------------------------------------
protected:
std::unique_ptr<MessagePump> pump_;
@@ -458,6 +462,9 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// Whether nesting is allowed.
bool allow_nesting_ = true;
+ // Whether task observers are allowed.
+ bool allow_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