Chromium Code Reviews| Index: mojo/message_pump/message_pump_mojo.h |
| diff --git a/mojo/message_pump/message_pump_mojo.h b/mojo/message_pump/message_pump_mojo.h |
| index 06869730eec7a0e1fa83622b3639432e905a744e..50c7812a0d6385c79019dbf07486e000228cb3a2 100644 |
| --- a/mojo/message_pump/message_pump_mojo.h |
| +++ b/mojo/message_pump/message_pump_mojo.h |
| @@ -6,6 +6,7 @@ |
| #define MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_H_ |
| #include <map> |
| +#include <set> |
| #include "base/macros.h" |
| #include "base/memory/scoped_ptr.h" |
| @@ -117,6 +118,10 @@ class MOJO_MESSAGE_PUMP_EXPORT MessagePumpMojo : public base::MessagePump { |
| base::Lock run_state_lock_; |
| HandleToHandler handlers_; |
| + // Set of handles that have a deadline set. Avoids iterating over all elements |
| + // in |handles_| in the common case (no deadline set). |
| + // TODO(amistry): Make this better and avoid special-casing deadlines. |
| + std::set<Handle> deadline_handles_; |
|
sky
2015/11/17 18:35:11
If we're really worried about efficiency, why don'
Anand Mistry (off Chromium)
2015/11/17 23:54:39
Sorting by TimeTicks would make removing by handle
sky
2015/11/17 23:58:42
If no one specifies a deadline, then wouldn't a bo
Anand Mistry (off Chromium)
2015/11/18 00:10:12
It would, but then if one user does come along and
|
| // An ever increasing value assigned to each Handler::id. Used to detect |
| // uniqueness while notifying. That is, while notifying expired timers we copy |