diff options
Diffstat (limited to 'mojo/public/python/src/python_system_helper.cc')
-rw-r--r-- | mojo/public/python/src/python_system_helper.cc | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/mojo/public/python/src/python_system_helper.cc b/mojo/public/python/src/python_system_helper.cc deleted file mode 100644 index 0c5a358..0000000 --- a/mojo/public/python/src/python_system_helper.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "mojo/public/python/src/python_system_helper.h" - -#include "Python.h" - -#include "mojo/public/cpp/utility/run_loop.h" -#include "mojo/public/python/src/common.h" - -namespace { -class QuitCurrentRunLoop : public mojo::Closure::Runnable { - public: - void Run() const override { - mojo::RunLoop::current()->Quit(); - } - - static mojo::Closure NewQuitClosure() { - return mojo::Closure( - static_cast<mojo::Closure::Runnable*>(new QuitCurrentRunLoop())); - } -}; - -} // namespace - -namespace mojo { -namespace python { - -Closure BuildClosure(PyObject* callable) { - if (!PyCallable_Check(callable)) - return Closure(); - - return mojo::Closure( - NewRunnableFromCallable(callable, QuitCurrentRunLoop::NewQuitClosure())); -} - -PythonAsyncWaiter* NewAsyncWaiter() { - return new PythonAsyncWaiter(QuitCurrentRunLoop::NewQuitClosure()); -} - -} // namespace python -} // namespace mojo |