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

Unified Diff: mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.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/imported/sample_import.mojom.dart
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 b03e037158d85ebf088b8932898f62e69ed0c736..ac858704633406fc2c5ef1d5ca7ea8821563046c 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
@@ -461,13 +461,13 @@ mojom_types.MojomInterface _sampleImportImportedInterface() {
class _ImportedInterfaceServiceDescription implements service_describer.ServiceDescription {
dynamic getTopLevelInterface([Function responseFactory]) =>
- _sampleImportImportedInterface();
+ responseFactory(_sampleImportImportedInterface());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
}
abstract class ImportedInterface {
@@ -637,8 +637,13 @@ class ImportedInterfaceStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _ImportedInterfaceServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _ImportedInterfaceServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698