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_PUBLIC_UTILITY_RUN_LOOP_H_ | 5 #ifndef MOJO_PUBLIC_UTILITY_RUN_LOOP_H_ |
6 #define MOJO_PUBLIC_UTILITY_RUN_LOOP_H_ | 6 #define MOJO_PUBLIC_UTILITY_RUN_LOOP_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "mojo/public/system/core_cpp.h" | 10 #include "mojo/public/system/core_cpp.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 namespace utility { | |
14 | 13 |
15 class RunLoopHandler; | 14 class RunLoopHandler; |
16 | 15 |
17 class RunLoop { | 16 class RunLoop { |
18 public: | 17 public: |
19 RunLoop(); | 18 RunLoop(); |
20 ~RunLoop(); | 19 ~RunLoop(); |
21 | 20 |
22 // Sets up state needed for RunLoop. This must be invoked before creating a | 21 // Sets up state needed for RunLoop. This must be invoked before creating a |
23 // RunLoop. | 22 // RunLoop. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // An ever increasing value assigned to each HandlerData::id. Used to detect | 87 // An ever increasing value assigned to each HandlerData::id. Used to detect |
89 // uniqueness while notifying. That is, while notifying expired timers we copy | 88 // uniqueness while notifying. That is, while notifying expired timers we copy |
90 // |handler_data_| and only notify handlers whose id match. If the id does not | 89 // |handler_data_| and only notify handlers whose id match. If the id does not |
91 // match it means the handler was removed then added so that we shouldn't | 90 // match it means the handler was removed then added so that we shouldn't |
92 // notify it. | 91 // notify it. |
93 int next_handler_id_; | 92 int next_handler_id_; |
94 | 93 |
95 MOJO_DISALLOW_COPY_AND_ASSIGN(RunLoop); | 94 MOJO_DISALLOW_COPY_AND_ASSIGN(RunLoop); |
96 }; | 95 }; |
97 | 96 |
98 } // namespace utility | |
99 } // namespace mojo | 97 } // namespace mojo |
100 | 98 |
101 #endif // MOJO_PUBLIC_UTILITY_RUN_LOOP_H_ | 99 #endif // MOJO_PUBLIC_UTILITY_RUN_LOOP_H_ |
OLD | NEW |