| Index: mojo/services/public/interfaces/network/url_loader.mojom
|
| diff --git a/mojo/services/public/interfaces/network/url_loader.mojom b/mojo/services/public/interfaces/network/url_loader.mojom
|
| index feab00a78ec2c4ac7d61f0298b0ffd4ecdf3130f..b4bcf09f89d1c94068171d0f726516962b3970a9 100644
|
| --- a/mojo/services/public/interfaces/network/url_loader.mojom
|
| +++ b/mojo/services/public/interfaces/network/url_loader.mojom
|
| @@ -7,20 +7,46 @@ import "network_error.mojom"
|
| module mojo {
|
|
|
| struct URLRequest {
|
| + // The URL to load.
|
| string url;
|
| +
|
| + // The HTTP method if applicable.
|
| string method = "GET";
|
| +
|
| + // Additional HTTP request headers.
|
| string[] headers;
|
| +
|
| + // The payload for the request body. For HTTP requests, the method must be
|
| + // set to "POST" or "PUT".
|
| handle<data_pipe_consumer> body;
|
| - int64 body_length = 0; // Set to -1 if length is unknown.
|
| - bool follow_redirects = false;
|
| +
|
| + // The number of bytes to be read from |body|. A Content-Length header of
|
| + // this value will be sent. Set to -1 if length is unknown, which will cause
|
| + // |body| to be uploaded using a chunked encoding.
|
| + int64 body_length = 0;
|
| +
|
| + // If set to true, then redirects will be automatically followed. Otherwise,
|
| + // when a redirect is encounterd, FollowRedirect must be called to proceed.
|
| + bool auto_follow_redirects = false;
|
| +
|
| + // If set to true, then the HTTP request will bypass the local cache and will
|
| + // have a 'Cache-Control: nocache' header added in that causes any proxy
|
| + // servers to also not satisfy the request from their cache. This has the
|
| + // effect of forcing a full end-to-end fetch.
|
| bool bypass_cache = false;
|
| };
|
|
|
| struct URLResponse {
|
| + // The final URL of the response, after redirects have been followed.
|
| string url;
|
| - string[] redirects; // The sequence of redirected URLs.
|
| +
|
| + // The HTTP status code. 0 if not applicable.
|
| uint32 status_code;
|
| +
|
| + // The HTTP status line.
|
| string status_line;
|
| +
|
| + // The HTTP response headers.
|
| string[] headers;
|
| };
|
|
|
| @@ -30,23 +56,23 @@ interface URLLoader {
|
| // be copied to |response_body_stream|.
|
| //
|
| // The client's |OnReceivedResponse| method will run when response meta data
|
| - // becomes available, or if a redirect is encountered and |follow_redirects|
|
| - // is false, the client's |OnRecievedRedirect| method will called.
|
| + // becomes available, or if a redirect response is encountered and
|
| + // |auto_follow_redirects| is false, the client's |OnRecievedRedirect| method
|
| + // will called instead.
|
| //
|
| // NOTE: You may observe data being pushed to |response_body_stream| before
|
| // you receive |OnReceivedResponse|.
|
| Start(URLRequest request, handle<data_pipe_producer> response_body_stream);
|
|
|
| - // If the request passed to |Start| was configured with |follow_redirects|
|
| - // set to false, then upon receiving a redirect, |OnReceivedRedirect| will be
|
| - // called. To follow the indicated redirect, call the |FollowRedirect|
|
| - // method.
|
| + // If the request passed to |Start| had |auto_follow_redirects| set to false,
|
| + // then upon receiving a redirect, |OnReceivedRedirect| will be called. To
|
| + // follow the indicated redirect, call the |FollowRedirect| method.
|
| FollowRedirect();
|
| };
|
|
|
| interface URLLoaderClient {
|
| // This method is called when a redirect is encountered, provided the
|
| - // request's |follow_redirects| attribute was set to false.
|
| + // request's |auto_follow_redirects| attribute was set to false.
|
| OnReceivedRedirect(URLResponse response, string new_url, string new_method);
|
|
|
| // This method is called when response meta data becomes available.
|
|
|