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

Unified Diff: base/message_loop/message_pump_mac.h

Issue 2889293002: Filter run loop modes in message_pump_mac.mm (Closed)
Patch Set: selfnits 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
« no previous file with comments | « no previous file | base/message_loop/message_pump_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_pump_mac.h
diff --git a/base/message_loop/message_pump_mac.h b/base/message_loop/message_pump_mac.h
index f0766eb860e592d5cab96c93db7ae57d36ce00bc..4dfb61193fc822bec39b81e3b3750a1e68acc70d 100644
--- a/base/message_loop/message_pump_mac.h
+++ b/base/message_loop/message_pump_mac.h
@@ -84,7 +84,7 @@ class BASE_EXPORT MessagePumpCFRunLoopBase : public MessagePump {
friend class TestMessagePumpCFRunLoopBase;
public:
- MessagePumpCFRunLoopBase();
+ explicit MessagePumpCFRunLoopBase(int mode_mask);
Mark Mentovai 2017/05/19 03:29:13 Since you aren’t providing the enum that has masky
tapted 2017/05/19 06:28:15 Done. Made this constructor protected also and fix
~MessagePumpCFRunLoopBase() override;
// Subclasses should implement the work they need to do in MessagePump::Run
@@ -114,6 +114,11 @@ class BASE_EXPORT MessagePumpCFRunLoopBase : public MessagePump {
// objects autoreleased by work to fall into the current autorelease pool.
virtual AutoreleasePoolType* CreateAutoreleasePool();
+ // Invokes method(run_loop_, arg, mode) for all the modes in |mode_mask_|.
+ template <typename Argument>
+ void InvokeForAllModes(void method(CFRunLoopRef, Argument, CFStringRef),
Mark Mentovai 2017/05/19 03:29:13 More a function than a method?
Mark Mentovai 2017/05/19 03:29:13 Since it’s restricted to mode_mask_, it shouldn’t
tapted 2017/05/19 06:28:15 Done.
tapted 2017/05/19 06:28:15 Done.
+ Argument argument);
+
private:
// Marking timers as invalid at the right time helps significantly reduce
// power use (see the comment in RunDelayedWorkTimer()), however there is no
@@ -190,6 +195,9 @@ class BASE_EXPORT MessagePumpCFRunLoopBase : public MessagePump {
// The thread's run loop.
CFRunLoopRef run_loop_;
+ // Bitmask controlling the run loop modes in which posted tasks may run.
+ const int mode_mask_;
+
// The timer, sources, and observers are described above alongside their
// callbacks.
CFRunLoopTimerRef delayed_work_timer_;
« no previous file with comments | « no previous file | base/message_loop/message_pump_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698