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

Unified Diff: third_party/mojo/src/mojo/public/tools/bindings/generators/go_templates/interface.tmpl

Issue 1058033002: NOT TO COMMITTED: Update mojo sdk to rev 0018e6a91b75bcb941c867f8a7aa1753c3b53a13 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/tools/bindings/generators/go_templates/interface.tmpl
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/go_templates/interface.tmpl b/third_party/mojo/src/mojo/public/tools/bindings/generators/go_templates/interface.tmpl
index c96441eaa105cf7c3b819df84d640659c06c59e7..25435e30f8303ca81fcade34ae9cbdbed6dc670d 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/go_templates/interface.tmpl
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/go_templates/interface.tmpl
@@ -42,9 +42,37 @@ type {{interface|name}} interface {
{% endfor %}
}
+var {{interface|name(False)}}_Name = "{{interface.module.namespace|replace(".","::")}}::{{interface.name}}"
+
type {{interface|name}}Request bindings.InterfaceRequest
+
+func (r *{{interface|name}}Request) Name() string {
+ return {{interface|name(False)}}_Name
+}
+
type {{interface|name}}Pointer bindings.InterfacePointer
+func (p *{{interface|name}}Pointer) Name() string {
+ return {{interface|name(False)}}_Name
+}
+
+type {{interface|name}}ServiceFactory struct{
+ Delegate {{interface|name}}Factory
+}
+
+type {{interface|name}}Factory interface {
+ Create(request {{interface|name}}Request)
+}
+
+func (f *{{interface|name}}ServiceFactory) Name() string {
+ return {{interface|name(False)}}_Name
+}
+
+func (f *{{interface|name}}ServiceFactory) Create(messagePipe system.MessagePipeHandle) {
+ request := {{interface|name}}Request{bindings.NewMessagePipeHandleOwner(messagePipe)}
+ f.Delegate.Create(request)
+}
+
// CreateMessagePipeFor{{interface|name}} creates a message pipe for use with the
// {{interface|name}} interface with a {{interface|name}}Request on one end and a {{interface|name}}Pointer on the other.
func CreateMessagePipeFor{{interface|name}}() ({{interface|name}}Request, {{interface|name}}Pointer) {

Powered by Google App Engine
This is Rietveld 408576698