Chromium Code Reviews| 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); |
| +}; |