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

Unified Diff: mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.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/math/math_calculator.mojom.dart
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 8ebdd4687912aa6633862ca96c0883f7cdc6ef8e..52d106b0600b0eb9e80dba114e6e99eadf5e5a61 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
@@ -539,13 +539,13 @@ mojom_types.MojomInterface _mathCalculatorCalculator() {
class _CalculatorServiceDescription implements service_describer.ServiceDescription {
dynamic getTopLevelInterface([Function responseFactory]) =>
- _mathCalculatorCalculator();
+ responseFactory(_mathCalculatorCalculator());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
}
abstract class Calculator {
@@ -871,8 +871,13 @@ class CalculatorStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _CalculatorServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _CalculatorServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698