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

Unified Diff: services/http_server/public/http_server.mojom

Issue 715153004: Add support for HTTP handlers that are in self-contained apps. Also add an example app. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« services/http_server/http_server.cc ('K') | « services/http_server/http_server.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/http_server/public/http_server.mojom
diff --git a/services/http_server/public/http_server.mojom b/services/http_server/public/http_server.mojom
index d5e982b89d90394be5cc79b69a0b07a3693d3c75..2fa327af242bc5874dff3d82f12e0380f02ac268 100644
--- a/services/http_server/public/http_server.mojom
+++ b/services/http_server/public/http_server.mojom
@@ -4,4 +4,22 @@
module mojo;
-// TODO(jam): interface for http_server
+import "services/http_server/public/http_request.mojom";
+import "services/http_server/public/http_response.mojom";
+
+[Client=HttpServerClient]
+interface HttpServerService {
+ // Add a handler for the given regex path.
+ AddHandler(string path) => (bool success);
+
+ // Remove a previously registered handler.
+ RemoveHandler(string path) => (bool success);
+
+ // Helper method to create an HttpResponse given the status code and body.
+ CreateResponse(uint32 status_code, string body) => (HttpResponse response);
yzshen1 2014/11/12 17:38:34 It seems this could be done in a client-side utili
jam 2014/11/12 20:48:40 yeah that's better; done
+};
+
+[Client=HttpServerService]
yzshen1 2014/11/12 17:38:33 Nit: usually you don't need to add this attribute,
jam 2014/11/12 20:48:41 ah, I didn't know that, thanks. i had copied this
yzshen1 2014/11/12 21:24:26 IMO it is nice to change but not a big issue.
+interface HttpServerClient {
+ OnHandleRequest(HttpRequest request) => (HttpResponse response);
+};
« services/http_server/http_server.cc ('K') | « services/http_server/http_server.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698