| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ | 5 #ifndef MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ |
| 6 #define MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ | 6 #define MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 MessagePumpMojo(); | 25 MessagePumpMojo(); |
| 26 virtual ~MessagePumpMojo(); | 26 virtual ~MessagePumpMojo(); |
| 27 | 27 |
| 28 // Static factory function (for using with |base::Thread::Options|, wrapped | 28 // Static factory function (for using with |base::Thread::Options|, wrapped |
| 29 // using |base::Bind()|). | 29 // using |base::Bind()|). |
| 30 static scoped_ptr<base::MessagePump> Create(); | 30 static scoped_ptr<base::MessagePump> Create(); |
| 31 | 31 |
| 32 // Registers a MessagePumpMojoHandler for the specified handle. Only one | 32 // Registers a MessagePumpMojoHandler for the specified handle. Only one |
| 33 // handler can be registered for a specified handle. | 33 // handler can be registered for a specified handle. |
| 34 // NOTE: a value of 0 for |deadline| indicates an indefinite timeout. |
| 34 void AddHandler(MessagePumpMojoHandler* handler, | 35 void AddHandler(MessagePumpMojoHandler* handler, |
| 35 const Handle& handle, | 36 const Handle& handle, |
| 36 MojoHandleSignals wait_signals, | 37 MojoHandleSignals wait_signals, |
| 37 base::TimeTicks deadline); | 38 base::TimeTicks deadline); |
| 38 | 39 |
| 39 void RemoveHandler(const Handle& handle); | 40 void RemoveHandler(const Handle& handle); |
| 40 | 41 |
| 41 // MessagePump: | 42 // MessagePump: |
| 42 virtual void Run(Delegate* delegate) OVERRIDE; | 43 virtual void Run(Delegate* delegate) OVERRIDE; |
| 43 virtual void Quit() OVERRIDE; | 44 virtual void Quit() OVERRIDE; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // notify it. | 99 // notify it. |
| 99 int next_handler_id_; | 100 int next_handler_id_; |
| 100 | 101 |
| 101 DISALLOW_COPY_AND_ASSIGN(MessagePumpMojo); | 102 DISALLOW_COPY_AND_ASSIGN(MessagePumpMojo); |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 } // namespace common | 105 } // namespace common |
| 105 } // namespace mojo | 106 } // namespace mojo |
| 106 | 107 |
| 107 #endif // MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ | 108 #endif // MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ |
| OLD | NEW |