OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MOJO_PYTHON_CONTENT_HANDLER_PYTHON_SYSTEM_IMPL_HELPER_H_ | |
6 #define MOJO_PYTHON_CONTENT_HANDLER_PYTHON_SYSTEM_IMPL_HELPER_H_ | |
7 | |
8 #include <Python.h> | |
9 | |
10 #include "base/base_export.h" | |
11 #include "base/message_loop/message_loop.h" | |
12 #include "base/run_loop.h" | |
13 #include "mojo/public/cpp/bindings/callback.h" | |
14 #include "mojo/public/cpp/system/core.h" | |
15 #include "mojo/public/python/src/common.h" | |
16 | |
17 namespace mojo { | |
18 namespace python { | |
19 | |
20 // Run loop for python | |
21 class PythonRunLoop { | |
22 public: | |
23 PythonRunLoop(); | |
24 | |
25 ~PythonRunLoop(); | |
26 | |
27 void Run(); | |
28 | |
29 void RunUntilIdle(); | |
30 | |
31 void Quit(); | |
32 | |
33 // Post a task to be executed roughtly after delay microseconds | |
34 void PostDelayedTask(PyObject* callable, int64 delay); | |
35 private: | |
36 base::MessageLoop loop_; | |
37 }; | |
38 | |
39 PythonAsyncWaiter* NewAsyncWaiter(); | |
40 | |
41 } // namespace python | |
42 } // namespace mojo | |
43 | |
44 #endif // MOJO_PYTHON_CONTENT_HANDLER_PYTHON_SYSTEM_IMPL_HELPER_H_ | |
45 | |
OLD | NEW |