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

Unified Diff: mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_interfaces.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/sample/sample_interfaces.mojom.dart
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 d680a3035f98ee60f2e2996bbd6369432da42a64..546be7341f5230ef23b9ab12c229931cbd02be7d 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
@@ -1664,13 +1664,13 @@ mojom_types.MojomInterface _sampleInterfacesProvider() {
class _ProviderServiceDescription implements service_describer.ServiceDescription {
dynamic getTopLevelInterface([Function responseFactory]) =>
- _sampleInterfacesProvider();
+ responseFactory(_sampleInterfacesProvider());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
}
abstract class Provider {
@@ -2113,8 +2113,13 @@ class ProviderStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _ProviderServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _ProviderServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}
const int _IntegerAccessor_getIntegerName = 0;
@@ -2143,13 +2148,13 @@ mojom_types.MojomInterface _sampleInterfacesIntegerAccessor() {
class _IntegerAccessorServiceDescription implements service_describer.ServiceDescription {
dynamic getTopLevelInterface([Function responseFactory]) =>
- _sampleInterfacesIntegerAccessor();
+ responseFactory(_sampleInterfacesIntegerAccessor());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
}
abstract class IntegerAccessor {
@@ -2378,8 +2383,13 @@ class IntegerAccessorStub extends bindings.Stub {
int get version => 3;
- service_describer.ServiceDescription get serviceDescription =>
- new _IntegerAccessorServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _IntegerAccessorServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}
const int _SampleInterface_sampleMethod0Name = 0;
@@ -2414,13 +2424,13 @@ mojom_types.MojomInterface _sampleInterfacesSampleInterface() {
class _SampleInterfaceServiceDescription implements service_describer.ServiceDescription {
dynamic getTopLevelInterface([Function responseFactory]) =>
- _sampleInterfacesSampleInterface();
+ responseFactory(_sampleInterfacesSampleInterface());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
}
abstract class SampleInterface {
@@ -2663,8 +2673,13 @@ class SampleInterfaceStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _SampleInterfaceServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _SampleInterfaceServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698