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. | |
35 void AddHandler(MessagePumpMojoHandler* handler, | 34 void AddHandler(MessagePumpMojoHandler* handler, |
36 const Handle& handle, | 35 const Handle& handle, |
37 MojoHandleSignals wait_signals, | 36 MojoHandleSignals wait_signals, |
38 base::TimeTicks deadline); | 37 base::TimeTicks deadline); |
39 | 38 |
40 void RemoveHandler(const Handle& handle); | 39 void RemoveHandler(const Handle& handle); |
41 | 40 |
42 // MessagePump: | 41 // MessagePump: |
43 virtual void Run(Delegate* delegate) OVERRIDE; | 42 virtual void Run(Delegate* delegate) OVERRIDE; |
44 virtual void Quit() OVERRIDE; | 43 virtual void Quit() OVERRIDE; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // notify it. | 98 // notify it. |
100 int next_handler_id_; | 99 int next_handler_id_; |
101 | 100 |
102 DISALLOW_COPY_AND_ASSIGN(MessagePumpMojo); | 101 DISALLOW_COPY_AND_ASSIGN(MessagePumpMojo); |
103 }; | 102 }; |
104 | 103 |
105 } // namespace common | 104 } // namespace common |
106 } // namespace mojo | 105 } // namespace mojo |
107 | 106 |
108 #endif // MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ | 107 #endif // MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ |
OLD | NEW |