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