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

Unified Diff: mojo/dart/packages/mojo_services/lib/http_server/http_server.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_services/lib/http_server/http_server.mojom.dart
diff --git a/mojo/dart/packages/mojo_services/lib/http_server/http_server.mojom.dart b/mojo/dart/packages/mojo_services/lib/http_server/http_server.mojom.dart
index a1d816a2791b6676f7c61a97c887916e7e4dd109..387f74b95535b7a9a20c835d39a31d8e4c1f15c0 100644
--- a/mojo/dart/packages/mojo_services/lib/http_server/http_server.mojom.dart
+++ b/mojo/dart/packages/mojo_services/lib/http_server/http_server.mojom.dart
@@ -463,11 +463,14 @@ const int _HttpServer_getPortName = 1;
class _HttpServerServiceDescription implements service_describer.ServiceDescription {
- dynamic getTopLevelInterface([Function responseFactory]) => null;
+ dynamic getTopLevelInterface([Function responseFactory]) =>
+ responseFactory(null);
- dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
+ dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
+ responseFactory(null);
- dynamic getAllTypeDefinitions([Function responseFactory]) => null;
+ dynamic getAllTypeDefinitions([Function responseFactory]) =>
+ responseFactory(null);
}
abstract class HttpServer {
@@ -737,8 +740,13 @@ class HttpServerStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _HttpServerServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _HttpServerServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}
const int _HttpHandler_handleRequestName = 0;
@@ -746,11 +754,14 @@ const int _HttpHandler_handleRequestName = 0;
class _HttpHandlerServiceDescription implements service_describer.ServiceDescription {
- dynamic getTopLevelInterface([Function responseFactory]) => null;
+ dynamic getTopLevelInterface([Function responseFactory]) =>
+ responseFactory(null);
- dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
+ dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
+ responseFactory(null);
- dynamic getAllTypeDefinitions([Function responseFactory]) => null;
+ dynamic getAllTypeDefinitions([Function responseFactory]) =>
+ responseFactory(null);
}
abstract class HttpHandler {
@@ -963,8 +974,13 @@ class HttpHandlerStub extends bindings.Stub {
int get version => 0;
- service_describer.ServiceDescription get serviceDescription =>
- new _HttpHandlerServiceDescription();
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _HttpHandlerServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698