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

Unified Diff: mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_unions.mojom.dart

Issue 1648803006: Expose Service Describer in Dart mojo package (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Address zra's feedback 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: mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_unions.mojom.dart
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 88373ea34b686fcd1cea211430725b7dd261c741..40c39204f41b6d366971c476cc643d3d14002223 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
@@ -3693,13 +3693,13 @@ mojom_types.MojomInterface _testUnionsSmallCache() {
class _SmallCacheServiceDescription implements service_describer.ServiceDescription {
dynamic getTopLevelInterface([Function responseFactory]) =>
- _testUnionsSmallCache();
+ responseFactory(_testUnionsSmallCache());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
}
abstract class SmallCache {
@@ -3926,8 +3926,13 @@ class SmallCacheStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _SmallCacheServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _SmallCacheServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}
const int _UnionInterface_echoName = 0;
@@ -3950,13 +3955,13 @@ mojom_types.MojomInterface _testUnionsUnionInterface() {
class _UnionInterfaceServiceDescription implements service_describer.ServiceDescription {
dynamic getTopLevelInterface([Function responseFactory]) =>
- _testUnionsUnionInterface();
+ responseFactory(_testUnionsUnionInterface());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
}
abstract class UnionInterface {
@@ -4169,8 +4174,13 @@ class UnionInterfaceStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _UnionInterfaceServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _UnionInterfaceServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698