OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package main | 5 package main |
6 | 6 |
7 import ( | 7 import ( |
8 "log" | 8 "log" |
9 | 9 |
10 "golang.org/x/mobile/app" | |
11 | |
12 "mojo/public/go/application" | 10 "mojo/public/go/application" |
13 "mojo/public/go/bindings" | 11 "mojo/public/go/bindings" |
14 "mojo/public/go/system" | 12 "mojo/public/go/system" |
15 | 13 |
16 "examples/echo/echo" | 14 "examples/echo/echo" |
17 ) | 15 ) |
18 | 16 |
19 //#include "mojo/public/c/system/types.h" | 17 //#include "mojo/public/c/system/types.h" |
20 import "C" | 18 import "C" |
21 | 19 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 stub.Close() | 55 stub.Close() |
58 } | 56 } |
59 } | 57 } |
60 | 58 |
61 //export MojoMain | 59 //export MojoMain |
62 func MojoMain(handle C.MojoHandle) C.MojoResult { | 60 func MojoMain(handle C.MojoHandle) C.MojoResult { |
63 application.Run(&EchoServerDelegate{}, system.MojoHandle(handle)) | 61 application.Run(&EchoServerDelegate{}, system.MojoHandle(handle)) |
64 return C.MOJO_RESULT_OK | 62 return C.MOJO_RESULT_OK |
65 } | 63 } |
66 | 64 |
67 func main() { | 65 func main() { |
jamesr
2015/08/05 23:53:41
when is func main() invoked when built as a shared
gauthamt
2015/08/06 00:08:04
It is not invoked when run as a shared library.
gautham
2015/08/06 00:10:17
Done.
| |
68 app.Run(app.Callbacks{}) | |
69 } | 66 } |
OLD | NEW |