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

Unified Diff: mojo/dart/packages/_mojo_for_test_only/lib/sample/sample_service.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_service.mojom.dart
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 eaee0d99975ab47cc0c09656b44d35f979790a64..8baadc38ea1c4c32486371ae3ba60dcdf23405db 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
@@ -2291,13 +2291,13 @@ mojom_types.MojomInterface _sampleServiceService() {
class _ServiceServiceDescription implements service_describer.ServiceDescription {
dynamic getTopLevelInterface([Function responseFactory]) =>
- _sampleServiceService();
+ responseFactory(_sampleServiceService());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
}
abstract class Service {
@@ -2528,8 +2528,13 @@ class ServiceStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _ServiceServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _ServiceServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}
const int _Port_postMessageName = 0;
@@ -2551,13 +2556,13 @@ mojom_types.MojomInterface _sampleServicePort() {
class _PortServiceDescription implements service_describer.ServiceDescription {
dynamic getTopLevelInterface([Function responseFactory]) =>
- _sampleServicePort();
+ responseFactory(_sampleServicePort());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
}
abstract class Port {
@@ -2729,8 +2734,13 @@ class PortStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _PortServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _PortServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698