| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 module mojo; | 5 module mojo; |
| 6 | 6 |
| 7 import "network/public/interfaces/http_message.mojom"; |
| 7 import "network/public/interfaces/network_error.mojom"; | 8 import "network/public/interfaces/network_error.mojom"; |
| 8 | 9 |
| 9 struct HTTPHeader { | |
| 10 string name; | |
| 11 string value; | |
| 12 }; | |
| 13 | |
| 14 struct URLRequest { | 10 struct URLRequest { |
| 15 // The URL to load. | 11 // The URL to load. |
| 16 string url; | 12 string url; |
| 17 | 13 |
| 18 // The HTTP method if applicable. | 14 // The HTTP method if applicable. |
| 19 string method = "GET"; | 15 string method = "GET"; |
| 20 | 16 |
| 21 // Additional HTTP request headers. | 17 // Additional HTTP request headers. |
| 22 array<HTTPHeader>? headers; | 18 array<HttpHeader>? headers; |
| 23 | 19 |
| 24 // The payload for the request body, represented as a concatenation of data | 20 // The payload for the request body, represented as a concatenation of data |
| 25 // streams. For HTTP requests, the method must be set to "POST" or "PUT". | 21 // streams. For HTTP requests, the method must be set to "POST" or "PUT". |
| 26 array<handle<data_pipe_consumer>>? body; | 22 array<handle<data_pipe_consumer>>? body; |
| 27 | 23 |
| 28 // The buffer size of the data pipe returned in URLResponse's |body| member. | 24 // The buffer size of the data pipe returned in URLResponse's |body| member. |
| 29 // A value of 0 indicates that the default buffer size should be used. This | 25 // A value of 0 indicates that the default buffer size should be used. This |
| 30 // value is just a suggestion. The URLLoader may choose to ignore this value. | 26 // value is just a suggestion. The URLLoader may choose to ignore this value. |
| 31 uint32 response_body_buffer_size = 0; | 27 uint32 response_body_buffer_size = 0; |
| 32 | 28 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 52 // The final URL of the response, after redirects have been followed. | 48 // The final URL of the response, after redirects have been followed. |
| 53 string? url; | 49 string? url; |
| 54 | 50 |
| 55 // The HTTP status code. 0 if not applicable. | 51 // The HTTP status code. 0 if not applicable. |
| 56 uint32 status_code; | 52 uint32 status_code; |
| 57 | 53 |
| 58 // The HTTP status line. | 54 // The HTTP status line. |
| 59 string? status_line; | 55 string? status_line; |
| 60 | 56 |
| 61 // The HTTP response headers. | 57 // The HTTP response headers. |
| 62 array<HTTPHeader>? headers; | 58 array<HttpHeader>? headers; |
| 63 | 59 |
| 64 // The MIME type of the response body. | 60 // The MIME type of the response body. |
| 65 string? mime_type; | 61 string? mime_type; |
| 66 | 62 |
| 67 // The character set of the response body. | 63 // The character set of the response body. |
| 68 string? charset; | 64 string? charset; |
| 69 | 65 |
| 70 // These fields are set to non-NULL if this response corresponds to a | 66 // These fields are set to non-NULL if this response corresponds to a |
| 71 // redirect. Call the |FollowRedirect| method on the URLLoader instance to | 67 // redirect. Call the |FollowRedirect| method on the URLLoader instance to |
| 72 // follow this redirect. | 68 // follow this redirect. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 96 Start(URLRequest request) => (URLResponse response); | 92 Start(URLRequest request) => (URLResponse response); |
| 97 | 93 |
| 98 // If the request passed to |Start| had |auto_follow_redirects| set to false, | 94 // If the request passed to |Start| had |auto_follow_redirects| set to false, |
| 99 // then upon receiving an URLResponse with a non-NULL |redirect_url| field, | 95 // then upon receiving an URLResponse with a non-NULL |redirect_url| field, |
| 100 // |FollowRedirect| may be called to load the URL indicated by the redirect. | 96 // |FollowRedirect| may be called to load the URL indicated by the redirect. |
| 101 FollowRedirect() => (URLResponse response); | 97 FollowRedirect() => (URLResponse response); |
| 102 | 98 |
| 103 // Query status about the URLLoader. | 99 // Query status about the URLLoader. |
| 104 QueryStatus() => (URLLoaderStatus status); | 100 QueryStatus() => (URLLoaderStatus status); |
| 105 }; | 101 }; |
| OLD | NEW |