OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "mojo/public/cpp/utility/run_loop.h" | 5 #include "mojo/public/cpp/utility/run_loop.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <mojo/macros.h> |
8 #include <pthread.h> | 9 #include <pthread.h> |
9 | 10 |
10 #include <algorithm> | 11 #include <algorithm> |
11 #include <limits> | 12 #include <limits> |
12 #include <utility> | 13 #include <utility> |
13 #include <vector> | 14 #include <vector> |
14 | 15 |
15 #include "mojo/public/c/system/macros.h" | |
16 #include "mojo/public/cpp/system/time.h" | 16 #include "mojo/public/cpp/system/time.h" |
17 #include "mojo/public/cpp/system/wait.h" | 17 #include "mojo/public/cpp/system/wait.h" |
18 #include "mojo/public/cpp/utility/run_loop_handler.h" | 18 #include "mojo/public/cpp/utility/run_loop_handler.h" |
19 | 19 |
20 namespace mojo { | 20 namespace mojo { |
21 namespace { | 21 namespace { |
22 | 22 |
23 // The initial and maximum number of results that we'll accept from | 23 // The initial and maximum number of results that we'll accept from |
24 // |WaitSetWait()|. TODO(vtl): I just made up these numbers. | 24 // |WaitSetWait()|. TODO(vtl): I just made up these numbers. |
25 constexpr uint32_t kInitialWaitSetNumResults = 16u; | 25 constexpr uint32_t kInitialWaitSetNumResults = 16u; |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 handler->OnHandleError(id, MOJO_RESULT_DEADLINE_EXCEEDED); | 387 handler->OnHandleError(id, MOJO_RESULT_DEADLINE_EXCEEDED); |
388 did_work = true; | 388 did_work = true; |
389 | 389 |
390 if (current_run_state_->should_quit) | 390 if (current_run_state_->should_quit) |
391 break; | 391 break; |
392 } | 392 } |
393 return did_work; | 393 return did_work; |
394 } | 394 } |
395 | 395 |
396 } // namespace mojo | 396 } // namespace mojo |
OLD | NEW |