Chromium Code Reviews| 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_; |