| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
| 6 module http_server; | 6 module http_server; |
| 7 | 7 |
| 8 import "http_server/interfaces/http_server.mojom"; | 8 import "http_server/interfaces/http_server.mojom"; |
| 9 import "network/interfaces/net_address.mojom"; | 9 import "network/interfaces/net_address.mojom"; |
| 10 | 10 |
| 11 [ServiceName="http_server::HttpServerFactory"] |
| 11 interface HttpServerFactory { | 12 interface HttpServerFactory { |
| 12 // Creates an http server running on the specified local network address. If | 13 // Creates an http server running on the specified local network address. If |
| 13 // |local_address| is null, it will take the default value of 0.0.0.0 at a | 14 // |local_address| is null, it will take the default value of 0.0.0.0 at a |
| 14 // system-allocated port. | 15 // system-allocated port. |
| 15 // | 16 // |
| 16 // Note that the port value of 0 means that the operating system will pick | 17 // Note that the port value of 0 means that the operating system will pick |
| 17 // one of available ports. You can use HttpServer::GetPort() to retrieve the | 18 // one of available ports. You can use HttpServer::GetPort() to retrieve the |
| 18 // allocated port. | 19 // allocated port. |
| 19 // | 20 // |
| 20 // Only one backing server will be created for each local network address. It | 21 // Only one backing server will be created for each local network address. It |
| 21 // will be shared among clients, if more than one client requests a server | 22 // will be shared among clients, if more than one client requests a server |
| 22 // running on a particular network address. | 23 // running on a particular network address. |
| 23 // | 24 // |
| 24 // TODO(ppi): would it be better to create a server only for the first caller | 25 // TODO(ppi): would it be better to create a server only for the first caller |
| 25 // and require the access to it to be explicitly shared by the party that | 26 // and require the access to it to be explicitly shared by the party that |
| 26 // requests it first? | 27 // requests it first? |
| 27 CreateHttpServer(HttpServer& server_request, mojo.NetAddress? local_address); | 28 CreateHttpServer(HttpServer& server_request, mojo.NetAddress? local_address); |
| 28 }; | 29 }; |
| OLD | NEW |