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

Side by Side Diff: third_party/go/src/golang.org/x/mobile/bind/seq/seq.go

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 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Package seq implements the machine-dependent seq serialization format.
6 //
7 // Implementations of Transact and FinalizeRef are provided by a
8 // specific foreign language binding package, e.g. go.mobile/bind/java.
9 //
10 // Designed only for use by the code generated by gobind. Don't try to
11 // use this directly.
12 package seq // import "golang.org/x/mobile/bind/seq"
13
14 // TODO(crawshaw):
15 // There is opportunity for optimizing these language
16 // bindings which requires deconstructing seq into something
17 // gnarly. So don't get too attached to the design.
18
19 import "fmt"
20
21 // Transact calls a method on a foreign object instance.
22 // It blocks until the call is complete.
23 var Transact func(ref *Ref, code int, in *Buffer) (out *Buffer)
24
25 // FinalizeRef is the finalizer used on foreign objects.
26 var FinalizeRef func(ref *Ref)
27
28 // A Func can be registered and called by a foreign language.
29 type Func func(out, in *Buffer)
30
31 // Registry holds functions callable from gobind generated bindings.
32 // Functions are keyed by descriptor and function code.
33 var Registry = make(map[string]map[int]Func)
34
35 // Register registers a function in the Registry.
36 func Register(descriptor string, code int, fn Func) {
37 m := Registry[descriptor]
38 if m == nil {
39 m = make(map[int]Func)
40 Registry[descriptor] = m
41 }
42 if m[code] != nil {
43 panic(fmt.Sprintf("registry.Register: %q/%d already registered", descriptor, code))
44 }
45 m[code] = fn
46 }
OLDNEW
« no previous file with comments | « third_party/go/src/golang.org/x/mobile/bind/seq/ref.go ('k') | third_party/go/src/golang.org/x/mobile/bind/seq/seq_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698