| 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 // Run loop for python |
| 20 class PythonRunLoop { |
| 21 public: |
| 22 PythonRunLoop(); |
| 23 |
| 24 ~PythonRunLoop(); |
| 25 |
| 26 void Run(); |
| 27 |
| 28 void RunUntilIdle(); |
| 29 |
| 30 void Quit(); |
| 31 |
| 32 // Post a task to be executed roughtly after delay microseconds |
| 33 void PostDelayedTask(PyObject* callable, int64 delay); |
| 34 private: |
| 35 base::MessageLoop loop_; |
| 36 }; |
| 37 |
| 38 PythonAsyncWaiter* NewAsyncWaiter(); |
| 39 |
| 40 } // namespace python |
| 41 } // namespace mojo |
| 42 |
| 43 #endif // MOJO_PYTHON_CONTENT_HANDLER_PYTHON_SYSTEM_IMPL_HELPER_H_ |
| 44 |
| OLD | NEW |