Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Unified Diff: mojo/public/python/mojo_system_impl.pyx

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/python/mojo_system.pyx ('k') | mojo/public/python/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/python/mojo_system_impl.pyx
diff --git a/mojo/public/python/mojo_system_impl.pyx b/mojo/public/python/mojo_system_impl.pyx
deleted file mode 100644
index 3b7cfebf83b5f976ed2c7a8c52072030daa2c23a..0000000000000000000000000000000000000000
--- a/mojo/public/python/mojo_system_impl.pyx
+++ /dev/null
@@ -1,72 +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.
-
-# distutils language = c++
-
-cimport c_async_waiter
-cimport c_environment
-cimport c_export # needed so the init function gets exported
-cimport c_thunks
-
-
-from libc.stdint cimport uintptr_t
-
-
-def SetSystemThunks(system_thunks_as_object):
- """Bind the basic Mojo Core functions.
- """
- cdef const c_thunks.MojoSystemThunks* system_thunks = (
- <const c_thunks.MojoSystemThunks*><uintptr_t>system_thunks_as_object)
- c_thunks.MojoSetSystemThunks(system_thunks)
-
-
-cdef class RunLoop(object):
- """RunLoop to use when using asynchronous operations on handles."""
-
- cdef c_environment.CRunLoop* c_run_loop
-
- def __init__(self):
- assert not <uintptr_t>(c_environment.CRunLoopCurrent())
- self.c_run_loop = new c_environment.CRunLoop()
-
- def __dealloc__(self):
- del self.c_run_loop
-
- def Run(self):
- """Run the runloop until Quit is called."""
- self.c_run_loop.Run()
-
- def RunUntilIdle(self):
- """Run the runloop until Quit is called or no operation is waiting."""
- self.c_run_loop.RunUntilIdle()
-
- def Quit(self):
- """Quit the runloop."""
- self.c_run_loop.Quit()
-
- def PostDelayedTask(self, runnable, delay=0):
- """
- Post a task on the runloop. This must be called from the thread owning the
- runloop.
- """
- cdef c_environment.CClosure closure = c_environment.BuildClosure(runnable)
- self.c_run_loop.PostDelayedTask(closure, delay)
-
-
-# We use a wrapping class to be able to call the C++ class PythonAsyncWaiter
-# across module boundaries.
-cdef class AsyncWaiter(object):
- cdef c_async_waiter.PythonAsyncWaiter* _c_async_waiter
-
- def __init__(self):
- self._c_async_waiter = c_environment.NewAsyncWaiter()
-
- def __dealloc__(self):
- del self._c_async_waiter
-
- def AsyncWait(self, handle, signals, deadline, callback):
- return self._c_async_waiter.AsyncWait(handle, signals, deadline, callback)
-
- def CancelWait(self, wait_id):
- self._c_async_waiter.CancelWait(wait_id)
« no previous file with comments | « mojo/public/python/mojo_system.pyx ('k') | mojo/public/python/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698