Chromium Code Reviews| Index: mojo/public/java/system/src/org/chromium/mojo/system/RunLoop.java |
| diff --git a/mojo/public/java/system/src/org/chromium/mojo/system/RunLoop.java b/mojo/public/java/system/src/org/chromium/mojo/system/RunLoop.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..279f336c8037d017df4fe4a4ad80121422df0d0c |
| --- /dev/null |
| +++ b/mojo/public/java/system/src/org/chromium/mojo/system/RunLoop.java |
| @@ -0,0 +1,39 @@ |
| +// 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. |
| + |
| +package org.chromium.mojo.system; |
| + |
| +/** |
| + * Definition of a run loop. |
| + */ |
| +public interface RunLoop extends AutoCloseable { |
|
qsr
2015/02/10 11:58:18
You should use Closeable instead of AutoCloseable,
etiennej
2015/02/10 14:32:04
Done.
|
| + /** |
| + * Start the run loop. It will continue until quit() is called. |
| + */ |
| + public void run(); |
| + |
| + /** |
| + * Start the run loop and stop it as soon as no task is present in the work queue. |
| + */ |
| + public void runUntilIdle(); |
| + |
| + /* |
| + * Quit the currently running run loop. |
| + */ |
| + public void quit(); |
| + |
| + /** |
| + * Add a runnable to the queue of tasks. |
| + * @param runnable Callback to be executed by the run loop. |
| + * @param delay Delay, in MojoTimeTicks (microseconds) before the callback should |
| + * be executed. |
| + */ |
| + public void postDelayedTask(Runnable runnable, long delay); |
| + |
| + /** |
| + * Closes the run loop and deregister it from Core. |
|
qsr
2015/02/10 11:58:18
I would use destroy or delete instead of close in
etiennej
2015/02/10 14:32:04
Done.
|
| + */ |
| + @Override |
| + public abstract void close(); |
| +} |