summaryrefslogtreecommitdiffstats
path: root/mojo/public/python/mojo_system_impl.pyx
diff options
context:
space:
mode:
authorblundell <blundell@chromium.org>2015-01-19 09:18:33 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-19 17:19:27 +0000
commit70fb54767b472a5edfb859e489beeeec7abdb0e4 (patch)
tree28e534ec774391a9f6571a1770e12a0d63ebf833 /mojo/public/python/mojo_system_impl.pyx
parentba5f0233fa38f949e24f6274ba891fa652eab640 (diff)
downloadchromium_src-70fb54767b472a5edfb859e489beeeec7abdb0e4.zip
chromium_src-70fb54767b472a5edfb859e489beeeec7abdb0e4.tar.gz
chromium_src-70fb54767b472a5edfb859e489beeeec7abdb0e4.tar.bz2
Move //mojo/{public, edk} underneath //third_party
This CL move //mojo/public and //mojo/edk to live in the following locations: - //third_party/mojo/src/mojo/public - //third_party/mojo/src/mojo/edk It moves the related gypfiles from //mojo to //third_party/mojo and updates them as necessary to account for the file moves. It also updates clients of the mojo SDK and EDK targets in both GYP and GN. (Note that for GN, the mojo SDK and EDK build systems are maintained in the Mojo repo and designed to be flexible wrt the location of the SDK/EDK in a client repo, so no changes are needed. This CL does not update include paths to the code being moved to limit the number of moving parts, instead relying on the include_dirs that the SDK and EDK targets supply to their direct dependents to ensure that include paths continue to resolve correctly. NOPRESUBMIT=true Review URL: https://codereview.chromium.org/814543006 Cr-Commit-Position: refs/heads/master@{#312129}
Diffstat (limited to 'mojo/public/python/mojo_system_impl.pyx')
-rw-r--r--mojo/public/python/mojo_system_impl.pyx75
1 files changed, 0 insertions, 75 deletions
diff --git a/mojo/public/python/mojo_system_impl.pyx b/mojo/public/python/mojo_system_impl.pyx
deleted file mode 100644
index 3e299c1..0000000
--- a/mojo/public/python/mojo_system_impl.pyx
+++ /dev/null
@@ -1,75 +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_environment.CEnvironment* _cenvironment
- cdef c_async_waiter.PythonAsyncWaiter* _c_async_waiter
-
- def __init__(self):
- self._cenvironment = new c_environment.CEnvironment()
- self._c_async_waiter = c_environment.NewAsyncWaiter()
-
- def __dealloc__(self):
- del self._c_async_waiter
- del self._cenvironment
-
- 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)