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

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: Responds to code review. 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..c0a5c1bf09c62552a09c0953ddc8820c6d1f1cc4 100644
--- a/mojom/mojom_parser/mojom/user_defined_types.go
+++ b/mojom/mojom_parser/mojom/user_defined_types.go
@@ -544,6 +544,11 @@ 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
}
func NewMojomInterface(declData DeclarationData) *MojomInterface {
@@ -551,6 +556,18 @@ func NewMojomInterface(declData DeclarationData) *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 == "ServiceName" {
+ if valueString, ok := attribute.Value.Value().(string); ok {
+ mojomInterface.ServiceName = &valueString
+ break
+ }
+ }
+ }
+ }
return mojomInterface
}
« no previous file with comments | « mojom/mojom_parser/generated/mojom_types/mojom_types.mojom.go ('k') | mojom/mojom_parser/serialization/serialization.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698