mojom_types.mojom: Changes the name |interface_name| to |service_name| in struct MojomInterface.

Also the mojom parser now populates this field with the correct service name (that is, the value of the "ServiceName" attribute) if it is set. The field was changed to nullable and will be unset if the interface does not have the attribute.

We removed the logic from mojom_translator.py that gets the service name from the "ServiceName" attribute and instead get it from the service_name field (which was set to the value in the "ServiceName" attribute in the parser.) The
interface_name field of mojom.Interface is now obtained from the decl_data.short_name field. Previously it was obtained from the interface_name field (which was set to the value of decl_data.short_name in the parser.)

BUG=#448
R=azani@chromium.org

Review URL: https://codereview.chromium.org/1677343002 .
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/dart_to_cpp/dart_to_cpp.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/dart_to_cpp/dart_to_cpp.mojom.dart
index 2f06238..bd52e43 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/dart_to_cpp/dart_to_cpp.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/dart_to_cpp/dart_to_cpp.mojom.dart
@@ -1101,7 +1101,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'CppSide'
       ..fullIdentifier = 'dart_to_cpp.CppSide')
-    ..interfaceName = 'CppSide'
+    ..serviceName_ = 'CppSide'
     ..methods = <int, mojom_types.MojomMethod>{
       _CppSide_startTestName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -1360,7 +1360,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'DartSide'
       ..fullIdentifier = 'dart_to_cpp.DartSide')
-    ..interfaceName = 'DartSide'
+    ..serviceName_ = 'DartSide'
     ..methods = <int, mojom_types.MojomMethod>{
       _DartSide_setClientName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
index 7a34cbd..b03e037 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
@@ -449,7 +449,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'ImportedInterface'
       ..fullIdentifier = 'imported.ImportedInterface')
-    ..interfaceName = 'ImportedInterface'
+    ..serviceName_ = 'ImportedInterface'
     ..methods = <int, mojom_types.MojomMethod>{
       _ImportedInterface_doSomethingName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.mojom.dart
index 60be897..8ebdd46 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.mojom.dart
@@ -514,7 +514,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'Calculator'
       ..fullIdentifier = 'math.Calculator')
-    ..interfaceName = 'Calculator'
+    ..serviceName_ = 'Calculator'
     ..methods = <int, mojom_types.MojomMethod>{
       _Calculator_clearName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/examples/echo.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/examples/echo.mojom.dart
index 2339258..1419fe8 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/examples/echo.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/examples/echo.mojom.dart
@@ -195,7 +195,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'Echo'
       ..fullIdentifier = 'mojo.examples.Echo')
-    ..interfaceName = 'Echo'
+    ..serviceName_ = 'Echo'
     ..methods = <int, mojom_types.MojomMethod>{
       _Echo_echoStringName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_structs.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_structs.mojom.dart
index a3a6354..a95a7d8 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_structs.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_structs.mojom.dart
@@ -7638,7 +7638,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'SomeInterface'
       ..fullIdentifier = 'mojo.test.SomeInterface')
-    ..interfaceName = 'SomeInterface'
+    ..serviceName_ = 'SomeInterface'
     ..methods = <int, mojom_types.MojomMethod>{
       _SomeInterface_someMethodName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_unions.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_unions.mojom.dart
index b8b43a8..88373ea 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_unions.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_unions.mojom.dart
@@ -3675,7 +3675,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'SmallCache'
       ..fullIdentifier = 'mojo.test.SmallCache')
-    ..interfaceName = 'SmallCache'
+    ..serviceName_ = 'SmallCache'
     ..methods = <int, mojom_types.MojomMethod>{
       _SmallCache_setIntValueName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -3937,7 +3937,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'UnionInterface'
       ..fullIdentifier = 'mojo.test.UnionInterface')
-    ..interfaceName = 'UnionInterface'
+    ..serviceName_ = 'UnionInterface'
     ..methods = <int, mojom_types.MojomMethod>{
       _UnionInterface_echoName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/validation_test_interfaces.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/validation_test_interfaces.mojom.dart
index e6f01e0..f40876c 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/validation_test_interfaces.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/validation_test_interfaces.mojom.dart
@@ -4152,7 +4152,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'InterfaceA'
       ..fullIdentifier = 'mojo.test.InterfaceA')
-    ..interfaceName = 'InterfaceA'
+    ..serviceName_ = 'InterfaceA'
     ..methods = <int, mojom_types.MojomMethod>{
     };
 }
@@ -4333,7 +4333,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'BoundsCheckTestInterface'
       ..fullIdentifier = 'mojo.test.BoundsCheckTestInterface')
-    ..interfaceName = 'BoundsCheckTestInterface'
+    ..serviceName_ = 'BoundsCheckTestInterface'
     ..methods = <int, mojom_types.MojomMethod>{
       _BoundsCheckTestInterface_method0Name: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -4611,7 +4611,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'ConformanceTestInterface'
       ..fullIdentifier = 'mojo.test.ConformanceTestInterface')
-    ..interfaceName = 'ConformanceTestInterface'
+    ..serviceName_ = 'ConformanceTestInterface'
     ..methods = <int, mojom_types.MojomMethod>{
       _ConformanceTestInterface_method0Name: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -5160,7 +5160,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'IntegrationTestInterface'
       ..fullIdentifier = 'mojo.test.IntegrationTestInterface')
-    ..interfaceName = 'IntegrationTestInterface'
+    ..serviceName_ = 'IntegrationTestInterface'
     ..methods = <int, mojom_types.MojomMethod>{
       _IntegrationTestInterface_method0Name: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/versioning/versioning_test_client.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/versioning/versioning_test_client.mojom.dart
index 6275dc6..dc13a6b 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/versioning/versioning_test_client.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/versioning/versioning_test_client.mojom.dart
@@ -962,7 +962,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'HumanResourceDatabase'
       ..fullIdentifier = 'mojo.test.versioning.HumanResourceDatabase')
-    ..interfaceName = 'HumanResourceDatabase'
+    ..serviceName_ = 'HumanResourceDatabase'
     ..methods = <int, mojom_types.MojomMethod>{
       _HumanResourceDatabase_addEmployeeName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/regression_tests/regression_tests.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/regression_tests/regression_tests.mojom.dart
index c8c69b9..27f2073 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/regression_tests/regression_tests.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/regression_tests/regression_tests.mojom.dart
@@ -2386,7 +2386,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'CheckMethodWithEmptyResponse'
       ..fullIdentifier = 'regression_tests.CheckMethodWithEmptyResponse')
-    ..interfaceName = 'CheckMethodWithEmptyResponse'
+    ..serviceName_ = 'CheckMethodWithEmptyResponse'
     ..methods = <int, mojom_types.MojomMethod>{
       _CheckMethodWithEmptyResponse_withoutParameterAndEmptyResponseName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -2689,7 +2689,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'CheckNameCollision'
       ..fullIdentifier = 'regression_tests.CheckNameCollision')
-    ..interfaceName = 'CheckNameCollision'
+    ..serviceName_ = 'CheckNameCollision'
     ..methods = <int, mojom_types.MojomMethod>{
       _CheckNameCollision_withNameCollisionName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -2934,7 +2934,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'CheckEnumCaps'
       ..fullIdentifier = 'regression_tests.CheckEnumCaps')
-    ..interfaceName = 'CheckEnumCaps'
+    ..serviceName_ = 'CheckEnumCaps'
     ..methods = <int, mojom_types.MojomMethod>{
       _CheckEnumCaps_setEnumWithInternalAllCapsName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -3134,7 +3134,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'TestInterface'
       ..fullIdentifier = 'regression_tests.TestInterface')
-    ..interfaceName = 'TestInterface'
+    ..serviceName_ = 'TestInterface'
     ..methods = <int, mojom_types.MojomMethod>{
       _TestInterface_someMessageName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -3333,7 +3333,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'Regression551'
       ..fullIdentifier = 'regression_tests.Regression551')
-    ..interfaceName = 'Regression551'
+    ..serviceName_ = 'Regression551'
     ..methods = <int, mojom_types.MojomMethod>{
       _Regression551_getName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -3576,7 +3576,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'ServiceName'
       ..fullIdentifier = 'regression_tests.ServiceName')
-    ..interfaceName = 'ServiceName'
+    ..serviceName_ = 'ServiceName'
     ..methods = <int, mojom_types.MojomMethod>{
       _ServiceName_serviceName_Name: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_factory.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_factory.mojom.dart
index cc49465..5cbccfe 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_factory.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_factory.mojom.dart
@@ -1337,7 +1337,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'NamedObject'
       ..fullIdentifier = 'sample.NamedObject')
-    ..interfaceName = 'NamedObject'
+    ..serviceName_ = 'NamedObject'
     ..methods = <int, mojom_types.MojomMethod>{
       _NamedObject_setNameName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -1603,7 +1603,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'Factory'
       ..fullIdentifier = 'sample.Factory')
-    ..interfaceName = 'Factory'
+    ..serviceName_ = 'Factory'
     ..methods = <int, mojom_types.MojomMethod>{
       _Factory_doStuffName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_interfaces.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_interfaces.mojom.dart
index 8c90e6d..d680a30 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_interfaces.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_interfaces.mojom.dart
@@ -1627,7 +1627,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'Provider'
       ..fullIdentifier = 'sample.Provider')
-    ..interfaceName = 'Provider'
+    ..serviceName_ = 'Provider'
     ..methods = <int, mojom_types.MojomMethod>{
       _Provider_echoStringName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -2125,7 +2125,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'IntegerAccessor'
       ..fullIdentifier = 'sample.IntegerAccessor')
-    ..interfaceName = 'IntegerAccessor'
+    ..serviceName_ = 'IntegerAccessor'
     ..methods = <int, mojom_types.MojomMethod>{
       _IntegerAccessor_getIntegerName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -2391,7 +2391,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'SampleInterface'
       ..fullIdentifier = 'sample.SampleInterface')
-    ..interfaceName = 'SampleInterface'
+    ..serviceName_ = 'SampleInterface'
     ..methods = <int, mojom_types.MojomMethod>{
       _SampleInterface_sampleMethod0Name: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_service.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_service.mojom.dart
index 4440d8a..eaee0d9 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_service.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_service.mojom.dart
@@ -2273,7 +2273,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'Service'
       ..fullIdentifier = 'sample.Service')
-    ..interfaceName = 'Service'
+    ..serviceName_ = 'Service'
     ..methods = <int, mojom_types.MojomMethod>{
       _Service_frobinateName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -2539,7 +2539,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'Port'
       ..fullIdentifier = 'sample.Port')
-    ..interfaceName = 'Port'
+    ..serviceName_ = 'Port'
     ..methods = <int, mojom_types.MojomMethod>{
       _Port_postMessageName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/test/echo_service.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/test/echo_service.mojom.dart
index 5a254c1..7e5992f 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/test/echo_service.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/test/echo_service.mojom.dart
@@ -456,7 +456,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'EchoService'
       ..fullIdentifier = 'test.EchoService')
-    ..interfaceName = 'EchoService'
+    ..serviceName_ = 'EchoService'
     ..methods = <int, mojom_types.MojomMethod>{
       _EchoService_echoStringName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart
index 069b10c..69399b2 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart
@@ -816,7 +816,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'PingPongService'
       ..fullIdentifier = 'test.PingPongService')
-    ..interfaceName = 'PingPongService'
+    ..serviceName_ = 'PingPongService'
     ..methods = <int, mojom_types.MojomMethod>{
       _PingPongService_setClientName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
@@ -1203,7 +1203,7 @@
     ..declData = (new mojom_types.DeclarationData()
       ..shortName = 'PingPongClient'
       ..fullIdentifier = 'test.PingPongClient')
-    ..interfaceName = 'PingPongClient'
+    ..serviceName_ = 'PingPongClient'
     ..methods = <int, mojom_types.MojomMethod>{
       _PingPongClient_pongName: new mojom_types.MojomMethod()
         ..declData = (new mojom_types.DeclarationData()
diff --git a/mojo/dart/packages/mojo/lib/mojo/bindings/types/mojom_types.mojom.dart b/mojo/dart/packages/mojo/lib/mojo/bindings/types/mojom_types.mojom.dart
index 7553330..a97fa51 100644
--- a/mojo/dart/packages/mojo/lib/mojo/bindings/types/mojom_types.mojom.dart
+++ b/mojo/dart/packages/mojo/lib/mojo/bindings/types/mojom_types.mojom.dart
@@ -1763,7 +1763,7 @@
     const bindings.StructDataHeader(32, 0)
   ];
   DeclarationData declData = null;
-  String interfaceName = null;
+  String serviceName_ = null;
   Map<int, MojomMethod> methods = null;
 
   MojomInterface() : super(kVersions.last.size);
@@ -1808,7 +1808,7 @@
     }
     if (mainDataHeader.version >= 0) {
       
-      result.interfaceName = decoder0.decodeString(16, false);
+      result.serviceName_ = decoder0.decodeString(16, true);
     }
     if (mainDataHeader.version >= 0) {
       
@@ -1851,10 +1851,10 @@
       rethrow;
     }
     try {
-      encoder0.encodeString(interfaceName, 16, false);
+      encoder0.encodeString(serviceName_, 16, true);
     } on bindings.MojoCodecError catch(e) {
       e.message = "Error encountered while encoding field "
-          "interfaceName of struct MojomInterface: $e";
+          "serviceName_ of struct MojomInterface: $e";
       rethrow;
     }
     try {
@@ -1884,14 +1884,14 @@
   String toString() {
     return "MojomInterface("
            "declData: $declData" ", "
-           "interfaceName: $interfaceName" ", "
+           "serviceName_: $serviceName_" ", "
            "methods: $methods" ")";
   }
 
   Map toJson() {
     Map map = new Map();
     map["declData"] = declData;
-    map["interfaceName"] = interfaceName;
+    map["serviceName_"] = serviceName_;
     map["methods"] = methods;
     return map;
   }
diff --git a/mojo/public/interfaces/bindings/mojom_types.mojom b/mojo/public/interfaces/bindings/mojom_types.mojom
index 6d8d7a8..c036559 100644
--- a/mojo/public/interfaces/bindings/mojom_types.mojom
+++ b/mojo/public/interfaces/bindings/mojom_types.mojom
@@ -262,10 +262,15 @@
 struct MojomInterface {
   DeclarationData? decl_data;
 
-  // By definition, the name of an interface is the string that would be passed
-  // to the method ServiceProvider.ConnectToService() in order obtain a
-  // connection to the interface.
-  string interface_name;
+  // 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. The presence of this field indicates
+  // that this is the top-level interface for the named service: When
+  // the method ConnectToService(service_name) from the ServiceProvider
+  // interface is invoked, an implementation of ServiceProvider will, by
+  // default, return the interface that has been annotated with the
+  // given service_name if there is a unique such interface.
+  string? service_name;
 
   // All the methods in the interface. The keys are the method ordinals.
   map<uint32, MojomMethod> methods;
diff --git a/mojo/public/tools/bindings/generators/dart_templates/mojom_type_macros.tmpl b/mojo/public/tools/bindings/generators/dart_templates/mojom_type_macros.tmpl
index 82ea195..32eaf3c 100644
--- a/mojo/public/tools/bindings/generators/dart_templates/mojom_type_macros.tmpl
+++ b/mojo/public/tools/bindings/generators/dart_templates/mojom_type_macros.tmpl
@@ -21,7 +21,7 @@
     ..declData = (new {{typepkg}}DeclarationData()
       ..shortName = '{{type|mojom_type_name|upper_camel}}'
       ..fullIdentifier = '{{type|fullidentifier}}')
-    ..interfaceName = '{{type|name}}'
+    ..serviceName_ = '{{type|name}}'
     ..methods = <int, {{typepkg}}MojomMethod>{
 {%- for method in type.methods %}
       _{{type|name}}_{{method|name}}Name: new {{typepkg}}MojomMethod()
diff --git a/mojo/public/tools/bindings/mojom_parser/bin/linux64/mojom_parser.sha1 b/mojo/public/tools/bindings/mojom_parser/bin/linux64/mojom_parser.sha1
index 958b693..69f3804 100644
--- a/mojo/public/tools/bindings/mojom_parser/bin/linux64/mojom_parser.sha1
+++ b/mojo/public/tools/bindings/mojom_parser/bin/linux64/mojom_parser.sha1
@@ -1 +1 @@
-84078357af2a58354fbe8d4ec0a53d9004a2b6c9
\ No newline at end of file
+10343680a45afac64f6ba495a72a214eb90654ab
\ No newline at end of file
diff --git a/mojo/public/tools/bindings/mojom_parser/bin/mac64/mojom_parser.sha1 b/mojo/public/tools/bindings/mojom_parser/bin/mac64/mojom_parser.sha1
index c96a465..f41234a 100644
--- a/mojo/public/tools/bindings/mojom_parser/bin/mac64/mojom_parser.sha1
+++ b/mojo/public/tools/bindings/mojom_parser/bin/mac64/mojom_parser.sha1
@@ -1 +1 @@
-e78fa3d9f471dd4274ce6d438097a58de4bed1bf
\ No newline at end of file
+edf0157ee31169677adf83493eaffcbf10594a17
\ No newline at end of file
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/generated/mojom_types_mojom.py b/mojo/public/tools/bindings/pylib/mojom/generate/generated/mojom_types_mojom.py
index 2ee8fe9..12a25ac 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/generated/mojom_types_mojom.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/generated/mojom_types_mojom.py
@@ -179,7 +179,7 @@
   DESCRIPTOR = {
     'fields': [
       _descriptor.SingleFieldGroup('decl_data', _descriptor.StructType(lambda: DeclarationData, nullable=True), 0, 0),
-      _descriptor.SingleFieldGroup('interface_name', _descriptor.TYPE_STRING, 1, 0),
+      _descriptor.SingleFieldGroup('service_name', _descriptor.TYPE_NULLABLE_STRING, 1, 0),
       _descriptor.SingleFieldGroup('methods', _descriptor.MapType(_descriptor.TYPE_UINT32, _descriptor.StructType(lambda: MojomMethod)), 2, 0),
     ],
   }
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
index 3bf1371..4a7d95c 100755
--- a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
@@ -393,12 +393,16 @@
         == mojom_types_mojom.UserDefinedType.Tags.interface_type)
     mojom_interface = mojom_type.interface_type
     interface.attributes = self.AttributesFromMojom(mojom_interface)
-    interface.service_name = None
-    if interface.attributes:
-      interface.service_name = interface.attributes.get('ServiceName')
     self.PopulateModuleOrImportedFrom(interface, mojom_interface)
-    interface.name = mojom_interface.interface_name
+    interface.name = mojom_interface.decl_data.short_name
     interface.spec = interface.name
+    interface.service_name = mojom_interface.service_name
+    if interface.attributes:
+      assert interface.service_name == interface.attributes.get(
+          'ServiceName', None), interface.service_name
+    else:
+      assert interface.service_name is None, interface.service_name
+
 
     # Translate the dictionary of methods into a list of module.Methods.
     # In order to have a deterministic ordering we sort by method ordinal.
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py
index f08babb..4bc4ca2 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py
@@ -73,9 +73,9 @@
     mojom_interface = mojom_types_mojom.MojomInterface(
         methods={},
         decl_data=mojom_types_mojom.DeclarationData(
+          short_name='AnInterface',
           source_file_info=mojom_types_mojom.SourceFileInfo(
-            file_name=file_name)),
-        interface_name='AnInterface')
+            file_name=file_name)))
     graph.resolved_types['interface_key'] = mojom_types_mojom.UserDefinedType(
         interface_type=mojom_interface)
 
@@ -145,7 +145,7 @@
     self.assertIn(imported_file_name, transitive_imports_paths)
     self.assertIn(second_level_imported_file_name, transitive_imports_paths)
 
-    self.assertEquals(mojom_interface.interface_name, mod.interfaces[0].name)
+    self.assertEquals('AnInterface', mod.interfaces[0].name)
     # Interfaces should be assigned their name as their spec.
     self.assertEquals('AnInterface', mod.interfaces[0].spec)
     self.assertEquals(mojom_struct.decl_data.short_name, mod.structs[0].name)
@@ -187,9 +187,9 @@
     file_name = 'a.mojom'
     mojom_interface = mojom_types_mojom.MojomInterface(
         decl_data=mojom_types_mojom.DeclarationData(
+          short_name='AnInterface',
           source_file_info=mojom_types_mojom.SourceFileInfo(
-            file_name=file_name)),
-        interface_name='AnInterface')
+            file_name=file_name)))
     mojom_interface.methods={}
 
     # Register the MojomInterface in a MojomFileGraph
@@ -506,12 +506,23 @@
         translator._transitive_imports['root/c.mojom'], struct.imported_from)
 
   def test_interface(self):
+    self.do_interface_test(True)
+    self.do_interface_test(False)
+
+  def do_interface_test(self, specify_service_name):
     file_name = 'a.mojom'
     mojom_interface = mojom_types_mojom.MojomInterface(
         decl_data=mojom_types_mojom.DeclarationData(
+          short_name='AnInterface',
           source_file_info=mojom_types_mojom.SourceFileInfo(
-            file_name=file_name)),
-        interface_name='AnInterface')
+            file_name=file_name)))
+    if specify_service_name:
+      mojom_interface.service_name = 'test::TheInterface'
+      mojom_interface.decl_data.attributes = [mojom_types_mojom.Attribute(
+          key='ServiceName', value=mojom_types_mojom.LiteralValue(
+              string_value='test::TheInterface'))]
+    else:
+      mojom_interface.service_name = None
     mojom_method10 = mojom_types_mojom.MojomMethod(
         ordinal=10,
         decl_data=mojom_types_mojom.DeclarationData(
@@ -543,10 +554,15 @@
       interface_type=mojom_interface))
 
     self.assertEquals(translator._module, interface.module)
-    self.assertEquals(mojom_interface.interface_name, interface.name)
+    self.assertEquals('AnInterface', interface.name)
     self.assertEquals(0, interface.methods[0].ordinal)
     self.assertEquals(7, interface.methods[1].ordinal)
     self.assertEquals(10, interface.methods[2].ordinal)
+    if specify_service_name:
+      self.assertEquals('test::TheInterface', interface.service_name)
+    else:
+      self.assertEquals(None, interface.service_name)
+
     # TODO(azani): Add the contained declarations.
 
   def test_method(self):
diff --git a/mojom/mojom_parser/generated/mojom_types/mojom_types.mojom.go b/mojom/mojom_parser/generated/mojom_types/mojom_types.mojom.go
index 0210d95..07409a3 100644
--- a/mojom/mojom_parser/generated/mojom_types/mojom_types.mojom.go
+++ b/mojom/mojom_parser/generated/mojom_types/mojom_types.mojom.go
@@ -11,234 +11,11 @@
 package mojom_types
 
 import (
-	"fmt"
-	"mojo/public/go/bindings"
-	"sort"
+	sort "sort"
+	fmt "fmt"
+	bindings "mojo/public/go/bindings"
 )
 
-// These IDs are the Mojom Identifiers / Type Keys.
-// Mojom libraries importing this one will use these identifiers when building
-// TypeReference objects.
-var ID_mojom_types_SimpleType__ string = "mojom_types_SimpleType__"
-var ID_mojom_types_BuiltinConstantValue__ string = "mojom_types_BuiltinConstantValue__"
-var ID_mojom_types_Kind__ string = "mojom_types_Kind__"
-var ID_mojom_types_StringType__ string = "mojom_types_StringType__"
-var ID_mojom_types_HandleType__ string = "mojom_types_HandleType__"
-var ID_mojom_types_ArrayType__ string = "mojom_types_ArrayType__"
-var ID_mojom_types_MapType__ string = "mojom_types_MapType__"
-var ID_mojom_types_TypeReference__ string = "mojom_types_TypeReference__"
-var ID_mojom_types_StructField__ string = "mojom_types_StructField__"
-var ID_mojom_types_DefaultKeyword__ string = "mojom_types_DefaultKeyword__"
-var ID_mojom_types_StructVersion__ string = "mojom_types_StructVersion__"
-var ID_mojom_types_MojomStruct__ string = "mojom_types_MojomStruct__"
-var ID_mojom_types_UnionField__ string = "mojom_types_UnionField__"
-var ID_mojom_types_MojomUnion__ string = "mojom_types_MojomUnion__"
-var ID_mojom_types_EnumValue__ string = "mojom_types_EnumValue__"
-var ID_mojom_types_MojomEnum__ string = "mojom_types_MojomEnum__"
-var ID_mojom_types_MojomMethod__ string = "mojom_types_MojomMethod__"
-var ID_mojom_types_MojomInterface__ string = "mojom_types_MojomInterface__"
-var ID_mojom_types_UserValueReference__ string = "mojom_types_UserValueReference__"
-var ID_mojom_types_DeclaredConstant__ string = "mojom_types_DeclaredConstant__"
-var ID_mojom_types_Attribute__ string = "mojom_types_Attribute__"
-var ID_mojom_types_DeclarationData__ string = "mojom_types_DeclarationData__"
-var ID_mojom_types_SourceFileInfo__ string = "mojom_types_SourceFileInfo__"
-var ID_mojom_types_ContainedDeclarations__ string = "mojom_types_ContainedDeclarations__"
-var ID_mojom_types_Type__ string = "mojom_types_Type__"
-var ID_mojom_types_UserDefinedType__ string = "mojom_types_UserDefinedType__"
-var ID_mojom_types_DefaultFieldValue__ string = "mojom_types_DefaultFieldValue__"
-var ID_mojom_types_Value__ string = "mojom_types_Value__"
-var ID_mojom_types_LiteralValue__ string = "mojom_types_LiteralValue__"
-var ID_mojom_types_UserDefinedValue__ string = "mojom_types_UserDefinedValue__"
-
-var mojom_typesDesc__ = make(map[string]UserDefinedType)
-func init() {
-    mojom_typesDesc__["mojom_types_SimpleType__"] = &UserDefinedTypeEnumType{
-    Value: mojom_types_SimpleType__(),
-  }
-    mojom_typesDesc__["mojom_types_BuiltinConstantValue__"] = &UserDefinedTypeEnumType{
-    Value: mojom_types_BuiltinConstantValue__(),
-  }
-    mojom_typesDesc__["mojom_types_Kind__"] = &UserDefinedTypeEnumType{
-    Value: mojom_types_Kind__(),
-  }
-    mojom_typesDesc__["mojom_types_StringType__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_StringType__(),
-  }
-
-    mojom_typesDesc__["mojom_types_HandleType__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_HandleType__(),
-  }
-
-
-    mojom_typesDesc__["mojom_types_ArrayType__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_ArrayType__(),
-  }
-
-
-  mojom_typesDesc__["mojom_types_Type__"] = &UserDefinedTypeUnionType{
-    Value: mojom_types_Type__(),
-  }
-
-
-
-  mojom_typesDesc__["mojom_types_MapType__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_MapType__(),
-  }
-
-
-
-
-
-  mojom_typesDesc__["mojom_types_TypeReference__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_TypeReference__(),
-  }
-
-
-
-
-
-
-        mojom_typesDesc__["mojom_types_StructField__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_StructField__(),
-  }
-  mojom_typesDesc__["mojom_types_DeclarationData__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_DeclarationData__(),
-  }
-
-
-
-
-
-
-  mojom_typesDesc__["mojom_types_SourceFileInfo__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_SourceFileInfo__(),
-  }
-
-
-
-
-  mojom_typesDesc__["mojom_types_ContainedDeclarations__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_ContainedDeclarations__(),
-  }
-
-
-
-
-
-
-  mojom_typesDesc__["mojom_types_DefaultFieldValue__"] = &UserDefinedTypeUnionType{
-    Value: mojom_types_DefaultFieldValue__(),
-  }
-  mojom_typesDesc__["mojom_types_Value__"] = &UserDefinedTypeUnionType{
-    Value: mojom_types_Value__(),
-  }
-  mojom_typesDesc__["mojom_types_LiteralValue__"] = &UserDefinedTypeUnionType{
-    Value: mojom_types_LiteralValue__(),
-  }
-
-
-
-
-
-
-
-
-
-
-
-
-
-  mojom_typesDesc__["mojom_types_UserValueReference__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_UserValueReference__(),
-  }
-
-
-
-
-
-
-  mojom_typesDesc__["mojom_types_DefaultKeyword__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_DefaultKeyword__(),
-  }
-
-
-
-      mojom_typesDesc__["mojom_types_StructVersion__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_StructVersion__(),
-  }
-
-
-
-    mojom_typesDesc__["mojom_types_MojomStruct__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_MojomStruct__(),
-  }
-
-
-
-    mojom_typesDesc__["mojom_types_UnionField__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_UnionField__(),
-  }
-
-
-
-    mojom_typesDesc__["mojom_types_MojomUnion__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_MojomUnion__(),
-  }
-
-
-    mojom_typesDesc__["mojom_types_EnumValue__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_EnumValue__(),
-  }
-
-
-
-
-    mojom_typesDesc__["mojom_types_MojomEnum__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_MojomEnum__(),
-  }
-
-
-    mojom_typesDesc__["mojom_types_MojomMethod__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_MojomMethod__(),
-  }
-
-
-
-
-    mojom_typesDesc__["mojom_types_MojomInterface__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_MojomInterface__(),
-  }
-
-
-
-      mojom_typesDesc__["mojom_types_DeclaredConstant__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_DeclaredConstant__(),
-  }
-
-
-
-    mojom_typesDesc__["mojom_types_Attribute__"] = &UserDefinedTypeStructType{
-    Value: mojom_types_Attribute__(),
-  }
-
-
-            mojom_typesDesc__["mojom_types_UserDefinedType__"] = &UserDefinedTypeUnionType{
-    Value: mojom_types_UserDefinedType__(),
-  }
-
-
-
-
-          mojom_typesDesc__["mojom_types_UserDefinedValue__"] = &UserDefinedTypeUnionType{
-    Value: mojom_types_UserDefinedValue__(),
-  }
-
-
-
-}
-func GetAllMojomTypeDefinitions() map[string]UserDefinedType {
-  return mojom_typesDesc__
-}
 
 type SimpleType int32
 
@@ -256,96 +33,7 @@
 	SimpleType_UinT64 = SimpleType_UinT32 + 1;
 )
 
-// String names and labels used by the MojomEnum types.
-var (
-  enumName_SimpleType = "SimpleType"
-  enumFieldName_SimpleType_Bool = "Bool"
-  enumFieldName_SimpleType_Double = "Double"
-  enumFieldName_SimpleType_Float = "Float"
-  enumFieldName_SimpleType_InT8 = "InT8"
-  enumFieldName_SimpleType_InT16 = "InT16"
-  enumFieldName_SimpleType_InT32 = "InT32"
-  enumFieldName_SimpleType_InT64 = "InT64"
-  enumFieldName_SimpleType_UinT8 = "UinT8"
-  enumFieldName_SimpleType_UinT16 = "UinT16"
-  enumFieldName_SimpleType_UinT32 = "UinT32"
-  enumFieldName_SimpleType_UinT64 = "UinT64"
-)
 
-func mojom_types_SimpleType__() MojomEnum {
-  return MojomEnum{
-    DeclData: &DeclarationData{
-      ShortName: &enumName_SimpleType,
-    },
-    Values: []EnumValue{EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_Bool,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(0),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_Double,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(1),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_Float,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(2),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_InT8,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(3),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_InT16,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(4),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_InT32,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(5),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_InT64,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(6),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_UinT8,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(7),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_UinT16,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(8),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_UinT32,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(9),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_SimpleType_UinT64,
-        },
-        EnumTypeKey: ID_mojom_types_SimpleType__,
-        IntValue: int32(10),
-      },},
-  }
-}
 
 type BuiltinConstantValue int32
 
@@ -358,61 +46,7 @@
 	BuiltinConstantValue_FloatNan = BuiltinConstantValue_FloatNegativeInfinity + 1;
 )
 
-// String names and labels used by the MojomEnum types.
-var (
-  enumName_BuiltinConstantValue = "BuiltinConstantValue"
-  enumFieldName_BuiltinConstantValue_DoubleInfinity = "DoubleInfinity"
-  enumFieldName_BuiltinConstantValue_DoubleNegativeInfinity = "DoubleNegativeInfinity"
-  enumFieldName_BuiltinConstantValue_DoubleNan = "DoubleNan"
-  enumFieldName_BuiltinConstantValue_FloatInfinity = "FloatInfinity"
-  enumFieldName_BuiltinConstantValue_FloatNegativeInfinity = "FloatNegativeInfinity"
-  enumFieldName_BuiltinConstantValue_FloatNan = "FloatNan"
-)
 
-func mojom_types_BuiltinConstantValue__() MojomEnum {
-  return MojomEnum{
-    DeclData: &DeclarationData{
-      ShortName: &enumName_BuiltinConstantValue,
-    },
-    Values: []EnumValue{EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_BuiltinConstantValue_DoubleInfinity,
-        },
-        EnumTypeKey: ID_mojom_types_BuiltinConstantValue__,
-        IntValue: int32(0),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_BuiltinConstantValue_DoubleNegativeInfinity,
-        },
-        EnumTypeKey: ID_mojom_types_BuiltinConstantValue__,
-        IntValue: int32(1),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_BuiltinConstantValue_DoubleNan,
-        },
-        EnumTypeKey: ID_mojom_types_BuiltinConstantValue__,
-        IntValue: int32(2),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_BuiltinConstantValue_FloatInfinity,
-        },
-        EnumTypeKey: ID_mojom_types_BuiltinConstantValue__,
-        IntValue: int32(3),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_BuiltinConstantValue_FloatNegativeInfinity,
-        },
-        EnumTypeKey: ID_mojom_types_BuiltinConstantValue__,
-        IntValue: int32(4),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_BuiltinConstantValue_FloatNan,
-        },
-        EnumTypeKey: ID_mojom_types_BuiltinConstantValue__,
-        IntValue: int32(5),
-      },},
-  }
-}
 
 type HandleType_Kind int32
 
@@ -424,54 +58,7 @@
 	HandleType_Kind_SharedBuffer = HandleType_Kind_DataPipeProducer + 1;
 )
 
-// String names and labels used by the MojomEnum types.
-var (
-  enumName_HandleType_Kind = "HandleType_Kind"
-  enumFieldName_HandleType_Kind_Unspecified = "Unspecified"
-  enumFieldName_HandleType_Kind_MessagePipe = "MessagePipe"
-  enumFieldName_HandleType_Kind_DataPipeConsumer = "DataPipeConsumer"
-  enumFieldName_HandleType_Kind_DataPipeProducer = "DataPipeProducer"
-  enumFieldName_HandleType_Kind_SharedBuffer = "SharedBuffer"
-)
 
-func mojom_types_Kind__() MojomEnum {
-  return MojomEnum{
-    DeclData: &DeclarationData{
-      ShortName: &enumName_HandleType_Kind,
-    },
-    Values: []EnumValue{EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_HandleType_Kind_Unspecified,
-        },
-        EnumTypeKey: ID_mojom_types_Kind__,
-        IntValue: int32(0),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_HandleType_Kind_MessagePipe,
-        },
-        EnumTypeKey: ID_mojom_types_Kind__,
-        IntValue: int32(1),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_HandleType_Kind_DataPipeConsumer,
-        },
-        EnumTypeKey: ID_mojom_types_Kind__,
-        IntValue: int32(2),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_HandleType_Kind_DataPipeProducer,
-        },
-        EnumTypeKey: ID_mojom_types_Kind__,
-        IntValue: int32(3),
-      },EnumValue{
-        DeclData: &DeclarationData{
-          ShortName: &enumFieldName_HandleType_Kind_SharedBuffer,
-        },
-        EnumTypeKey: ID_mojom_types_Kind__,
-        IntValue: int32(4),
-      },},
-  }
-}
 
 type StringType struct {
 	Nullable bool
@@ -524,24 +111,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_StringType = "StringType"
-  structFieldName_StringType_Nullable = "Nullable"
-)
 
-func mojom_types_StringType__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_StringType,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_StringType_Nullable,
-        },
-        Type: &TypeSimpleType{SimpleType_Bool},
-      },},
-  }
-}
 
 type HandleType struct {
 	Nullable bool
@@ -605,33 +175,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_HandleType = "HandleType"
-  structFieldName_HandleType_Nullable = "Nullable"
-  structFieldName_HandleType_Kind = "Kind"
-)
 
-func mojom_types_HandleType__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_HandleType,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_HandleType_Nullable,
-        },
-        Type: &TypeSimpleType{SimpleType_Bool},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_HandleType_Kind,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Kind__,
-  TypeKey: &ID_mojom_types_Kind__,},
-},
-      },},
-  }
-}
 
 type ArrayType struct {
 	Nullable bool
@@ -712,39 +256,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_ArrayType = "ArrayType"
-  structFieldName_ArrayType_Nullable = "Nullable"
-  structFieldName_ArrayType_FixedLength = "FixedLength"
-  structFieldName_ArrayType_ElementType = "ElementType"
-)
 
-func mojom_types_ArrayType__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_ArrayType,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_ArrayType_Nullable,
-        },
-        Type: &TypeSimpleType{SimpleType_Bool},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_ArrayType_FixedLength,
-        },
-        Type: &TypeSimpleType{SimpleType_InT32},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_ArrayType_ElementType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Type__,
-  TypeKey: &ID_mojom_types_Type__,},
-},
-      },},
-  }
-}
 
 type MapType struct {
 	Nullable bool
@@ -831,42 +343,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_MapType = "MapType"
-  structFieldName_MapType_Nullable = "Nullable"
-  structFieldName_MapType_KeyType = "KeyType"
-  structFieldName_MapType_ValueType = "ValueType"
-)
 
-func mojom_types_MapType__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_MapType,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MapType_Nullable,
-        },
-        Type: &TypeSimpleType{SimpleType_Bool},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MapType_KeyType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Type__,
-  TypeKey: &ID_mojom_types_Type__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MapType_ValueType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Type__,
-  TypeKey: &ID_mojom_types_Type__,},
-},
-      },},
-  }
-}
 
 type TypeReference struct {
 	Nullable bool
@@ -984,42 +461,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_TypeReference = "TypeReference"
-  structFieldName_TypeReference_Nullable = "Nullable"
-  structFieldName_TypeReference_IsInterfaceRequest = "IsInterfaceRequest"
-  structFieldName_TypeReference_Identifier = "Identifier"
-  structFieldName_TypeReference_TypeKey = "TypeKey"
-)
 
-func mojom_types_TypeReference__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_TypeReference,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_TypeReference_Nullable,
-        },
-        Type: &TypeSimpleType{SimpleType_Bool},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_TypeReference_IsInterfaceRequest,
-        },
-        Type: &TypeSimpleType{SimpleType_Bool},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_TypeReference_Identifier,
-        },
-        Type: &TypeStringType{StringType{true}},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_TypeReference_TypeKey,
-        },
-        Type: &TypeStringType{StringType{true}},
-      },},
-  }
-}
 
 type StructField struct {
 	DeclData *DeclarationData
@@ -1129,51 +571,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_StructField = "StructField"
-  structFieldName_StructField_DeclData = "DeclData"
-  structFieldName_StructField_Type = "Type"
-  structFieldName_StructField_DefaultValue = "DefaultValue"
-  structFieldName_StructField_Offset = "Offset"
-)
 
-func mojom_types_StructField__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_StructField,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_StructField_DeclData,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_DeclarationData__,
-  TypeKey: &ID_mojom_types_DeclarationData__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_StructField_Type,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Type__,
-  TypeKey: &ID_mojom_types_Type__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_StructField_DefaultValue,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_DefaultFieldValue__,
-  TypeKey: &ID_mojom_types_DefaultFieldValue__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_StructField_Offset,
-        },
-        Type: &TypeSimpleType{SimpleType_InT32},
-      },},
-  }
-}
 
 type DefaultKeyword struct {
 }
@@ -1215,18 +613,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_DefaultKeyword = "DefaultKeyword"
-)
 
-func mojom_types_DefaultKeyword__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_DefaultKeyword,
-    },Fields: []StructField{},
-  }
-}
 
 type StructVersion struct {
 	VersionNumber uint32
@@ -1301,36 +688,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_StructVersion = "StructVersion"
-  structFieldName_StructVersion_VersionNumber = "VersionNumber"
-  structFieldName_StructVersion_NumFields = "NumFields"
-  structFieldName_StructVersion_NumBytes = "NumBytes"
-)
 
-func mojom_types_StructVersion__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_StructVersion,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_StructVersion_VersionNumber,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT32},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_StructVersion_NumFields,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT32},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_StructVersion_NumBytes,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT32},
-      },},
-  }
-}
 
 type MojomStruct struct {
 	DeclData *DeclarationData
@@ -1496,51 +854,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_MojomStruct = "MojomStruct"
-  structFieldName_MojomStruct_DeclData = "DeclData"
-  structFieldName_MojomStruct_Fields = "Fields"
-  structFieldName_MojomStruct_VersionInfo = "VersionInfo"
-)
 
-func mojom_types_MojomStruct__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_MojomStruct,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomStruct_DeclData,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_DeclarationData__,
-  TypeKey: &ID_mojom_types_DeclarationData__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomStruct_Fields,
-        },
-        Type: &TypeArrayType{
-    Value: ArrayType{ElementType: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_StructField__,
-  TypeKey: &ID_mojom_types_StructField__,},
-},
-    },
-  },
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomStruct_VersionInfo,
-        },
-        Type: &TypeArrayType{
-    Value: ArrayType{Nullable: true,ElementType: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_StructVersion__,
-  TypeKey: &ID_mojom_types_StructVersion__,},
-},
-    },
-  },
-      },},
-  }
-}
 
 type UnionField struct {
 	DeclData *DeclarationData
@@ -1635,42 +949,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_UnionField = "UnionField"
-  structFieldName_UnionField_DeclData = "DeclData"
-  structFieldName_UnionField_Type = "Type"
-  structFieldName_UnionField_Tag = "Tag"
-)
 
-func mojom_types_UnionField__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_UnionField,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_UnionField_DeclData,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_DeclarationData__,
-  TypeKey: &ID_mojom_types_DeclarationData__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_UnionField_Type,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Type__,
-  TypeKey: &ID_mojom_types_Type__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_UnionField_Tag,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT32},
-      },},
-  }
-}
 
 type MojomUnion struct {
 	DeclData *DeclarationData
@@ -1784,39 +1063,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_MojomUnion = "MojomUnion"
-  structFieldName_MojomUnion_DeclData = "DeclData"
-  structFieldName_MojomUnion_Fields = "Fields"
-)
 
-func mojom_types_MojomUnion__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_MojomUnion,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomUnion_DeclData,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_DeclarationData__,
-  TypeKey: &ID_mojom_types_DeclarationData__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomUnion_Fields,
-        },
-        Type: &TypeArrayType{
-    Value: ArrayType{ElementType: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_UnionField__,
-  TypeKey: &ID_mojom_types_UnionField__,},
-},
-    },
-  },
-      },},
-  }
-}
 
 type EnumValue struct {
 	DeclData *DeclarationData
@@ -1931,48 +1178,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_EnumValue = "EnumValue"
-  structFieldName_EnumValue_DeclData = "DeclData"
-  structFieldName_EnumValue_EnumTypeKey = "EnumTypeKey"
-  structFieldName_EnumValue_InitializerValue = "InitializerValue"
-  structFieldName_EnumValue_IntValue = "IntValue"
-)
 
-func mojom_types_EnumValue__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_EnumValue,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_EnumValue_DeclData,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_DeclarationData__,
-  TypeKey: &ID_mojom_types_DeclarationData__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_EnumValue_EnumTypeKey,
-        },
-        Type: &TypeStringType{StringType{false}},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_EnumValue_InitializerValue,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_Value__,
-  TypeKey: &ID_mojom_types_Value__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_EnumValue_IntValue,
-        },
-        Type: &TypeSimpleType{SimpleType_InT32},
-      },},
-  }
-}
 
 type MojomEnum struct {
 	DeclData *DeclarationData
@@ -2086,39 +1292,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_MojomEnum = "MojomEnum"
-  structFieldName_MojomEnum_DeclData = "DeclData"
-  structFieldName_MojomEnum_Values = "Values"
-)
 
-func mojom_types_MojomEnum__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_MojomEnum,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomEnum_DeclData,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_DeclarationData__,
-  TypeKey: &ID_mojom_types_DeclarationData__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomEnum_Values,
-        },
-        Type: &TypeArrayType{
-    Value: ArrayType{ElementType: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_EnumValue__,
-  TypeKey: &ID_mojom_types_EnumValue__,},
-},
-    },
-  },
-      },},
-  }
-}
 
 type MojomMethod struct {
 	DeclData *DeclarationData
@@ -2241,55 +1415,11 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_MojomMethod = "MojomMethod"
-  structFieldName_MojomMethod_DeclData = "DeclData"
-  structFieldName_MojomMethod_Parameters = "Parameters"
-  structFieldName_MojomMethod_ResponseParams = "ResponseParams"
-  structFieldName_MojomMethod_Ordinal = "Ordinal"
-)
 
-func mojom_types_MojomMethod__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_MojomMethod,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomMethod_DeclData,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_DeclarationData__,
-  TypeKey: &ID_mojom_types_DeclarationData__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomMethod_Parameters,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_MojomStruct__,
-  TypeKey: &ID_mojom_types_MojomStruct__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomMethod_ResponseParams,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_MojomStruct__,
-  TypeKey: &ID_mojom_types_MojomStruct__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomMethod_Ordinal,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT32},
-      },},
-  }
-}
 
 type MojomInterface struct {
 	DeclData *DeclarationData
-	InterfaceName string
+	ServiceName *string
 	Methods map[uint32]MojomMethod
 }
 
@@ -2305,11 +1435,15 @@
 			return err
 		}
 	}
-	if err := encoder.WritePointer(); err != nil {
-		return err
-	}
-	if err := encoder.WriteString(s.InterfaceName); err != nil {
-		return err
+	if s.ServiceName == nil {
+		encoder.WriteNullPointer()
+	} else {
+		if err := encoder.WritePointer(); err != nil {
+			return err
+		}
+		if err := encoder.WriteString((*s.ServiceName)); err != nil {
+			return err
+		}
 	}
 	if err := encoder.WritePointer(); err != nil {
 		return err
@@ -2402,13 +1536,14 @@
 			return err
 		}
 		if pointer0 == 0 {
-			return &bindings.ValidationError{bindings.UnexpectedNullPointer, "unexpected null pointer"}
+			s.ServiceName = nil
 		} else {
+			s.ServiceName = new(string)
 			value0, err := decoder.ReadString()
 			if err != nil {
 				return err
 			}
-			s.InterfaceName = value0
+			(*s.ServiceName) = value0
 		}
 	}
 	if header.ElementsOrVersion >= 0 {
@@ -2502,46 +1637,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_MojomInterface = "MojomInterface"
-  structFieldName_MojomInterface_DeclData = "DeclData"
-  structFieldName_MojomInterface_InterfaceName = "InterfaceName"
-  structFieldName_MojomInterface_Methods = "Methods"
-)
 
-func mojom_types_MojomInterface__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_MojomInterface,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomInterface_DeclData,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_DeclarationData__,
-  TypeKey: &ID_mojom_types_DeclarationData__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomInterface_InterfaceName,
-        },
-        Type: &TypeStringType{StringType{false}},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_MojomInterface_Methods,
-        },
-        Type: &TypeMapType{
-    Value: MapType{KeyType: &TypeSimpleType{SimpleType_UinT32},
-      ValueType: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_MojomMethod__,
-  TypeKey: &ID_mojom_types_MojomMethod__,},
-},
-    },
-  },
-      },},
-  }
-}
 
 type UserValueReference struct {
 	Identifier string
@@ -2647,39 +1743,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_UserValueReference = "UserValueReference"
-  structFieldName_UserValueReference_Identifier = "Identifier"
-  structFieldName_UserValueReference_ValueKey = "ValueKey"
-  structFieldName_UserValueReference_ResolvedConcreteValue = "ResolvedConcreteValue"
-)
 
-func mojom_types_UserValueReference__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_UserValueReference,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_UserValueReference_Identifier,
-        },
-        Type: &TypeStringType{StringType{false}},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_UserValueReference_ValueKey,
-        },
-        Type: &TypeStringType{StringType{true}},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_UserValueReference_ResolvedConcreteValue,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_Value__,
-  TypeKey: &ID_mojom_types_Value__,},
-},
-      },},
-  }
-}
 
 type DeclaredConstant struct {
 	DeclData DeclarationData
@@ -2775,45 +1839,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_DeclaredConstant = "DeclaredConstant"
-  structFieldName_DeclaredConstant_DeclData = "DeclData"
-  structFieldName_DeclaredConstant_Type = "Type"
-  structFieldName_DeclaredConstant_Value = "Value"
-)
 
-func mojom_types_DeclaredConstant__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_DeclaredConstant,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclaredConstant_DeclData,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_DeclarationData__,
-  TypeKey: &ID_mojom_types_DeclarationData__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclaredConstant_Type,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Type__,
-  TypeKey: &ID_mojom_types_Type__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclaredConstant_Value,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Value__,
-  TypeKey: &ID_mojom_types_Value__,},
-},
-      },},
-  }
-}
 
 type Attribute struct {
 	Key string
@@ -2894,33 +1920,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_Attribute = "Attribute"
-  structFieldName_Attribute_Key = "Key"
-  structFieldName_Attribute_Value = "Value"
-)
 
-func mojom_types_Attribute__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_Attribute,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_Attribute_Key,
-        },
-        Type: &TypeStringType{StringType{false}},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_Attribute_Value,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_LiteralValue__,
-  TypeKey: &ID_mojom_types_LiteralValue__,},
-},
-      },},
-  }
-}
 
 type DeclarationData struct {
 	Attributes *[]Attribute
@@ -3178,84 +2178,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_DeclarationData = "DeclarationData"
-  structFieldName_DeclarationData_Attributes = "Attributes"
-  structFieldName_DeclarationData_MinVersion = "MinVersion"
-  structFieldName_DeclarationData_ShortName = "ShortName"
-  structFieldName_DeclarationData_FullIdentifier = "FullIdentifier"
-  structFieldName_DeclarationData_DeclaredOrdinal = "DeclaredOrdinal"
-  structFieldName_DeclarationData_DeclarationOrder = "DeclarationOrder"
-  structFieldName_DeclarationData_SourceFileInfo = "SourceFileInfo"
-  structFieldName_DeclarationData_ContainedDeclarations = "ContainedDeclarations"
-  structFieldName_DeclarationData_ContainerTypeKey = "ContainerTypeKey"
-)
 
-func mojom_types_DeclarationData__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_DeclarationData,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclarationData_Attributes,
-        },
-        Type: &TypeArrayType{
-    Value: ArrayType{Nullable: true,ElementType: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Attribute__,
-  TypeKey: &ID_mojom_types_Attribute__,},
-},
-    },
-  },
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclarationData_MinVersion,
-        },
-        Type: &TypeSimpleType{SimpleType_InT32},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclarationData_ShortName,
-        },
-        Type: &TypeStringType{StringType{true}},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclarationData_FullIdentifier,
-        },
-        Type: &TypeStringType{StringType{true}},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclarationData_DeclaredOrdinal,
-        },
-        Type: &TypeSimpleType{SimpleType_InT32},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclarationData_DeclarationOrder,
-        },
-        Type: &TypeSimpleType{SimpleType_InT32},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclarationData_SourceFileInfo,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_SourceFileInfo__,
-  TypeKey: &ID_mojom_types_SourceFileInfo__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclarationData_ContainedDeclarations,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Nullable: true,Identifier: &ID_mojom_types_ContainedDeclarations__,
-  TypeKey: &ID_mojom_types_ContainedDeclarations__,},
-},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_DeclarationData_ContainerTypeKey,
-        },
-        Type: &TypeStringType{StringType{true}},
-      },},
-  }
-}
 
 type SourceFileInfo struct {
 	FileName string
@@ -3341,36 +2264,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_SourceFileInfo = "SourceFileInfo"
-  structFieldName_SourceFileInfo_FileName = "FileName"
-  structFieldName_SourceFileInfo_LineNumber = "LineNumber"
-  structFieldName_SourceFileInfo_ColumnNumber = "ColumnNumber"
-)
 
-func mojom_types_SourceFileInfo__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_SourceFileInfo,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_SourceFileInfo_FileName,
-        },
-        Type: &TypeStringType{StringType{false}},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_SourceFileInfo_LineNumber,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT32},
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_SourceFileInfo_ColumnNumber,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT32},
-      },},
-  }
-}
 
 type ContainedDeclarations struct {
 	Enums *[]string
@@ -3520,36 +2414,7 @@
 	return nil
 }
 
-// String names and labels used by the MojomStruct types.
-var (
-  structName_ContainedDeclarations = "ContainedDeclarations"
-  structFieldName_ContainedDeclarations_Enums = "Enums"
-  structFieldName_ContainedDeclarations_Constants = "Constants"
-)
 
-func mojom_types_ContainedDeclarations__() MojomStruct {
-  return MojomStruct{
-    DeclData: &DeclarationData{
-      ShortName: &structName_ContainedDeclarations,
-    },Fields: []StructField{StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_ContainedDeclarations_Enums,
-        },
-        Type: &TypeArrayType{
-    Value: ArrayType{Nullable: true,ElementType: &TypeStringType{StringType{false}},
-    },
-  },
-      },StructField{
-        DeclData: &DeclarationData{
-          ShortName: &structFieldName_ContainedDeclarations_Constants,
-        },
-        Type: &TypeArrayType{
-    Value: ArrayType{Nullable: true,ElementType: &TypeStringType{StringType{false}},
-    },
-  },
-      },},
-  }
-}
 
 type Type interface {
 	Tag() uint32
@@ -3832,78 +2697,7 @@
 }
 
 
-// String names and labels used by the MojomUnion types.
-var (
-  unionName_Type = "Type"
-  unionFieldName_Type_SimpleType = "SimpleType"
-  unionFieldName_Type_StringType = "StringType"
-  unionFieldName_Type_ArrayType = "ArrayType"
-  unionFieldName_Type_MapType = "MapType"
-  unionFieldName_Type_HandleType = "HandleType"
-  unionFieldName_Type_TypeReference = "TypeReference"
-)
 
-func mojom_types_Type__() MojomUnion {
-  return MojomUnion{
-    DeclData: &DeclarationData{
-      ShortName: &unionName_Type,
-    },Fields: []UnionField{UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_Type_SimpleType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_SimpleType__,
-  TypeKey: &ID_mojom_types_SimpleType__,},
-},
-        Tag: 0,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_Type_StringType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_StringType__,
-  TypeKey: &ID_mojom_types_StringType__,},
-},
-        Tag: 1,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_Type_ArrayType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_ArrayType__,
-  TypeKey: &ID_mojom_types_ArrayType__,},
-},
-        Tag: 2,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_Type_MapType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_MapType__,
-  TypeKey: &ID_mojom_types_MapType__,},
-},
-        Tag: 3,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_Type_HandleType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_HandleType__,
-  TypeKey: &ID_mojom_types_HandleType__,},
-},
-        Tag: 4,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_Type_TypeReference,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_TypeReference__,
-  TypeKey: &ID_mojom_types_TypeReference__,},
-},
-        Tag: 5,
-      },},
-  }
-}
 
 type UserDefinedType interface {
 	Tag() uint32
@@ -4111,58 +2905,7 @@
 }
 
 
-// String names and labels used by the MojomUnion types.
-var (
-  unionName_UserDefinedType = "UserDefinedType"
-  unionFieldName_UserDefinedType_EnumType = "EnumType"
-  unionFieldName_UserDefinedType_StructType = "StructType"
-  unionFieldName_UserDefinedType_UnionType = "UnionType"
-  unionFieldName_UserDefinedType_InterfaceType = "InterfaceType"
-)
 
-func mojom_types_UserDefinedType__() MojomUnion {
-  return MojomUnion{
-    DeclData: &DeclarationData{
-      ShortName: &unionName_UserDefinedType,
-    },Fields: []UnionField{UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_UserDefinedType_EnumType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_MojomEnum__,
-  TypeKey: &ID_mojom_types_MojomEnum__,},
-},
-        Tag: 0,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_UserDefinedType_StructType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_MojomStruct__,
-  TypeKey: &ID_mojom_types_MojomStruct__,},
-},
-        Tag: 1,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_UserDefinedType_UnionType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_MojomUnion__,
-  TypeKey: &ID_mojom_types_MojomUnion__,},
-},
-        Tag: 2,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_UserDefinedType_InterfaceType,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_MojomInterface__,
-  TypeKey: &ID_mojom_types_MojomInterface__,},
-},
-        Tag: 3,
-      },},
-  }
-}
 
 type DefaultFieldValue interface {
 	Tag() uint32
@@ -4302,38 +3045,7 @@
 }
 
 
-// String names and labels used by the MojomUnion types.
-var (
-  unionName_DefaultFieldValue = "DefaultFieldValue"
-  unionFieldName_DefaultFieldValue_Value = "Value"
-  unionFieldName_DefaultFieldValue_DefaultKeyword = "DefaultKeyword"
-)
 
-func mojom_types_DefaultFieldValue__() MojomUnion {
-  return MojomUnion{
-    DeclData: &DeclarationData{
-      ShortName: &unionName_DefaultFieldValue,
-    },Fields: []UnionField{UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_DefaultFieldValue_Value,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_Value__,
-  TypeKey: &ID_mojom_types_Value__,},
-},
-        Tag: 0,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_DefaultFieldValue_DefaultKeyword,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_DefaultKeyword__,
-  TypeKey: &ID_mojom_types_DefaultKeyword__,},
-},
-        Tag: 1,
-      },},
-  }
-}
 
 type Value interface {
 	Tag() uint32
@@ -4506,48 +3218,7 @@
 }
 
 
-// String names and labels used by the MojomUnion types.
-var (
-  unionName_Value = "Value"
-  unionFieldName_Value_LiteralValue = "LiteralValue"
-  unionFieldName_Value_UserValueReference = "UserValueReference"
-  unionFieldName_Value_BuiltinValue = "BuiltinValue"
-)
 
-func mojom_types_Value__() MojomUnion {
-  return MojomUnion{
-    DeclData: &DeclarationData{
-      ShortName: &unionName_Value,
-    },Fields: []UnionField{UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_Value_LiteralValue,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_LiteralValue__,
-  TypeKey: &ID_mojom_types_LiteralValue__,},
-},
-        Tag: 0,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_Value_UserValueReference,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_UserValueReference__,
-  TypeKey: &ID_mojom_types_UserValueReference__,},
-},
-        Tag: 1,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_Value_BuiltinValue,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_BuiltinConstantValue__,
-  TypeKey: &ID_mojom_types_BuiltinConstantValue__,},
-},
-        Tag: 2,
-      },},
-  }
-}
 
 type LiteralValue interface {
 	Tag() uint32
@@ -4994,102 +3665,7 @@
 }
 
 
-// String names and labels used by the MojomUnion types.
-var (
-  unionName_LiteralValue = "LiteralValue"
-  unionFieldName_LiteralValue_BoolValue = "BoolValue"
-  unionFieldName_LiteralValue_DoubleValue = "DoubleValue"
-  unionFieldName_LiteralValue_FloatValue = "FloatValue"
-  unionFieldName_LiteralValue_Int8Value = "Int8Value"
-  unionFieldName_LiteralValue_Int16Value = "Int16Value"
-  unionFieldName_LiteralValue_Int32Value = "Int32Value"
-  unionFieldName_LiteralValue_Int64Value = "Int64Value"
-  unionFieldName_LiteralValue_StringValue = "StringValue"
-  unionFieldName_LiteralValue_Uint8Value = "Uint8Value"
-  unionFieldName_LiteralValue_Uint16Value = "Uint16Value"
-  unionFieldName_LiteralValue_Uint32Value = "Uint32Value"
-  unionFieldName_LiteralValue_Uint64Value = "Uint64Value"
-)
 
-func mojom_types_LiteralValue__() MojomUnion {
-  return MojomUnion{
-    DeclData: &DeclarationData{
-      ShortName: &unionName_LiteralValue,
-    },Fields: []UnionField{UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_BoolValue,
-        },
-        Type: &TypeSimpleType{SimpleType_Bool},
-        Tag: 0,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_DoubleValue,
-        },
-        Type: &TypeSimpleType{SimpleType_Double},
-        Tag: 1,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_FloatValue,
-        },
-        Type: &TypeSimpleType{SimpleType_Float},
-        Tag: 2,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_Int8Value,
-        },
-        Type: &TypeSimpleType{SimpleType_InT8},
-        Tag: 3,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_Int16Value,
-        },
-        Type: &TypeSimpleType{SimpleType_InT16},
-        Tag: 4,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_Int32Value,
-        },
-        Type: &TypeSimpleType{SimpleType_InT32},
-        Tag: 5,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_Int64Value,
-        },
-        Type: &TypeSimpleType{SimpleType_InT64},
-        Tag: 6,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_StringValue,
-        },
-        Type: &TypeStringType{StringType{false}},
-        Tag: 7,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_Uint8Value,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT8},
-        Tag: 8,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_Uint16Value,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT16},
-        Tag: 9,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_Uint32Value,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT32},
-        Tag: 10,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_LiteralValue_Uint64Value,
-        },
-        Type: &TypeSimpleType{SimpleType_UinT64},
-        Tag: 11,
-      },},
-  }
-}
 
 type UserDefinedValue interface {
 	Tag() uint32
@@ -5213,36 +3789,5 @@
 }
 
 
-// String names and labels used by the MojomUnion types.
-var (
-  unionName_UserDefinedValue = "UserDefinedValue"
-  unionFieldName_UserDefinedValue_EnumValue = "EnumValue"
-  unionFieldName_UserDefinedValue_DeclaredConstant = "DeclaredConstant"
-)
 
-func mojom_types_UserDefinedValue__() MojomUnion {
-  return MojomUnion{
-    DeclData: &DeclarationData{
-      ShortName: &unionName_UserDefinedValue,
-    },Fields: []UnionField{UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_UserDefinedValue_EnumValue,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_EnumValue__,
-  TypeKey: &ID_mojom_types_EnumValue__,},
-},
-        Tag: 0,
-      },UnionField{
-        DeclData: &DeclarationData{
-          ShortName: &unionFieldName_UserDefinedValue_DeclaredConstant,
-        },
-        Type: &TypeTypeReference{
-  Value: TypeReference {Identifier: &ID_mojom_types_DeclaredConstant__,
-  TypeKey: &ID_mojom_types_DeclaredConstant__,},
-},
-        Tag: 1,
-      },},
-  }
-}
 
diff --git a/mojom/mojom_parser/mojom/user_defined_types.go b/mojom/mojom_parser/mojom/user_defined_types.go
index 0841cb0..c0a5c1b 100644
--- a/mojom/mojom_parser/mojom/user_defined_types.go
+++ b/mojom/mojom_parser/mojom/user_defined_types.go
@@ -544,6 +544,11 @@
 	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 @@
 	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
 }
 
diff --git a/mojom/mojom_parser/serialization/serialization.go b/mojom/mojom_parser/serialization/serialization.go
index 3325516..6290c71 100644
--- a/mojom/mojom_parser/serialization/serialization.go
+++ b/mojom/mojom_parser/serialization/serialization.go
@@ -208,8 +208,7 @@
 	mojomInterface.Value.DeclData = translateDeclarationData(&intrfc.DeclarationData)
 	mojomInterface.Value.DeclData.ContainedDeclarations = translateContainedDeclarations(&intrfc.NestedDeclarations)
 
-	// TODO(rudominer) The Interface name field need not be the name from the .mojom file.
-	mojomInterface.Value.InterfaceName = intrfc.SimpleName()
+	mojomInterface.Value.ServiceName = intrfc.ServiceName
 
 	mojomInterface.Value.Methods = make(map[uint32]mojom_types.MojomMethod)
 	for ordinal, method := range intrfc.MethodsByOrdinal {
diff --git a/mojom/mojom_parser/serialization/serialization_test.go b/mojom/mojom_parser/serialization/serialization_test.go
index ad81314..f8457b9 100644
--- a/mojom/mojom_parser/serialization/serialization_test.go
+++ b/mojom/mojom_parser/serialization/serialization_test.go
@@ -445,8 +445,7 @@
 
 		// interface EchoService
 		test.expectedGraph().ResolvedTypes["TYPE_KEY:test.EchoService"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
-			DeclData:      test.newDeclData("EchoService", "test.EchoService"),
-			InterfaceName: "EchoService",
+			DeclData: test.newDeclData("EchoService", "test.EchoService"),
 			Methods: map[uint32]mojom_types.MojomMethod{
 				0: mojom_types.MojomMethod{
 					DeclData: test.newDeclData("EchoString", ""),
@@ -502,6 +501,58 @@
 	}
 
 	////////////////////////////////////////////////////////////
+	// Test Case: Use of the ServiceName attribute
+	////////////////////////////////////////////////////////////
+	{
+
+		contents := `
+	module test;
+
+	[ServiceName = "my.test.EchoService"]
+	interface EchoService {
+      EchoString(string? value) => (string? value);
+    };`
+
+		test.addTestCase("test", contents)
+
+		// DeclaredMojomObjects
+		test.expectedFile().DeclaredMojomObjects.Interfaces = &[]string{"TYPE_KEY:test.EchoService"}
+
+		// ResolvedTypes
+
+		// interface EchoService
+		test.expectedGraph().ResolvedTypes["TYPE_KEY:test.EchoService"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
+			DeclData:    test.newDeclDataA("EchoService", "test.EchoService", &[]mojom_types.Attribute{{"ServiceName", &mojom_types.LiteralValueStringValue{"my.test.EchoService"}}}),
+			ServiceName: stringPointer("my.test.EchoService"),
+			Methods: map[uint32]mojom_types.MojomMethod{
+				0: mojom_types.MojomMethod{
+					DeclData: test.newDeclData("EchoString", ""),
+					Parameters: mojom_types.MojomStruct{
+						DeclData: test.newDeclData("EchoString-request", ""),
+						Fields: []mojom_types.StructField{
+							mojom_types.StructField{
+								DeclData: test.newDeclData("value", ""),
+								Type:     &mojom_types.TypeStringType{mojom_types.StringType{true}},
+							},
+						},
+					},
+					ResponseParams: &mojom_types.MojomStruct{
+						DeclData: test.newDeclData("EchoString-response", ""),
+						Fields: []mojom_types.StructField{
+							mojom_types.StructField{
+								DeclData: test.newDeclData("value", ""),
+								Type:     &mojom_types.TypeStringType{mojom_types.StringType{true}},
+							},
+						},
+					},
+				},
+			},
+		}}
+
+		test.endTestCase()
+	}
+
+	////////////////////////////////////////////////////////////
 	// Test Case: Integer constants
 	////////////////////////////////////////////////////////////
 	{