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

Unified Diff: mojom/mojom_parser/mojom/user_defined_types.go

Issue 1677343002: mojom_types.mojom: Changes the name |interface_name| to |service_name| in struct MojomInterface. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 10 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: mojom/mojom_parser/mojom/user_defined_types.go
diff --git a/mojom/mojom_parser/mojom/user_defined_types.go b/mojom/mojom_parser/mojom/user_defined_types.go
index 0841cb0b952319df128e26690082c34f66c7e872..8b03889720e7548b812a4043da9f7c6470fcd333 100644
--- a/mojom/mojom_parser/mojom/user_defined_types.go
+++ b/mojom/mojom_parser/mojom/user_defined_types.go
@@ -544,13 +544,32 @@ type MojomInterface struct {
methodsByName map[string]*MojomMethod
methodsByLexicalOrder []*MojomMethod
+
+ // If the declaration of this interface has been annotated with the
+ // "ServiceName=" attribute then this field contains the value of that
+ // attribute, otherwise this is null.
+ ServiceName *string
}
+const serviceNameAttribute = "ServiceName"
azani 2016/02/10 00:06:39 Given that it's used in only one location, I don't
rudominer 2016/02/10 00:43:49 Done.
+
func NewMojomInterface(declData DeclarationData) *MojomInterface {
mojomInterface := new(MojomInterface)
mojomInterface.MethodsByOrdinal = make(map[uint32]*MojomMethod)
mojomInterface.methodsByName = make(map[string]*MojomMethod)
mojomInterface.Init(declData, mojomInterface)
+ // Search for an attribute named "ServiceName" with a string value.
+ // If that is found take the value as |ServiceName|.
+ if declData.attributes != nil && declData.attributes.List != nil {
+ for _, attribute := range declData.attributes.List {
+ if attribute.Key == serviceNameAttribute {
+ if valueString, ok := attribute.Value.Value().(string); ok {
+ mojomInterface.ServiceName = &valueString
+ break
+ }
+ }
+ }
+ }
return mojomInterface
}

Powered by Google App Engine
This is Rietveld 408576698