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

Side by Side Diff: third_party/go/src/golang.org/x/mobile/app/Go.java

Issue 1275153002: Remove third_party/golang.org/x/mobile as it is no longer used with Go 1.5. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Remove golang.org/x/mobile Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 package go;
2
3 import android.content.Context;
4 import android.os.Looper;
5 import android.util.Log;
6
7 // Go is an entry point for libraries compiled in Go.
8 // In an app's Application.onCreate, call:
9 //
10 // Go.init(getApplicationContext());
11 //
12 // When the function returns, it is safe to start calling
13 // Go code.
14 public final class Go {
15 // init loads libgojni.so and starts the runtime.
16 public static void init(final Context ctx) {
17 if (Looper.myLooper() != Looper.getMainLooper()) {
18 Log.wtf("Go", "Go.init must be called from main thread ( looper="+Looper.myLooper().toString()+")");
19 }
20 if (running) {
21 return;
22 }
23 running = true;
24
25 // TODO(crawshaw): context.registerComponentCallbacks for runtim e.GC
26
27 System.loadLibrary("gojni");
28
29 new Thread("GoMain") {
30 public void run() {
31 Go.run(ctx);
32 }
33 }.start();
34
35 Go.waitForRun();
36
37 new Thread("GoReceive") {
38 public void run() { Seq.receive(); }
39 }.start();
40 }
41
42 private static boolean running = false;
43
44 private static native void run(Context ctx);
45 private static native void waitForRun();
46 }
OLDNEW
« no previous file with comments | « third_party/go/src/golang.org/x/mobile/README.md ('k') | third_party/go/src/golang.org/x/mobile/app/android.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698