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

Unified Diff: third_party/mojo/src/mojo/public/python/mojo_system.pyx

Issue 954643002: Update mojo sdk to rev 3d23dae011859a2aae49f1d1adde705c8e85d819 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use run_renderer_in_process() Created 5 years, 10 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
Index: third_party/mojo/src/mojo/public/python/mojo_system.pyx
diff --git a/third_party/mojo/src/mojo/public/python/mojo_system.pyx b/third_party/mojo/src/mojo/public/python/mojo_system.pyx
index 4e684af5ccc72774d82de3c11f1a7e38094f32e4..d5f164df446a7c60258a4c2187fecbba533f898f 100644
--- a/third_party/mojo/src/mojo/public/python/mojo_system.pyx
+++ b/third_party/mojo/src/mojo/public/python/mojo_system.pyx
@@ -19,7 +19,7 @@ from cpython.mem cimport PyMem_Malloc, PyMem_Free
from cpython.object cimport Py_EQ, Py_NE
from libc.stdint cimport int32_t, int64_t, uint32_t, uint64_t, uintptr_t
-import ctypes
+import weakref
import threading
import mojo_system_impl
@@ -770,7 +770,7 @@ class RunLoop(object):
def __init__(self):
self.__run_loop = mojo_system_impl.RunLoop()
- _RUN_LOOPS.loop = id(self)
+ _RUN_LOOPS.loop = weakref.ref(self)
def __del__(self):
del _RUN_LOOPS.loop
@@ -797,7 +797,7 @@ class RunLoop(object):
@staticmethod
def Current():
if hasattr(_RUN_LOOPS, 'loop'):
- return ctypes.cast(_RUN_LOOPS.loop, ctypes.py_object).value
+ return _RUN_LOOPS.loop()
return None

Powered by Google App Engine
This is Rietveld 408576698