OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module content.mojom; |
| 6 |
| 7 [Native] |
| 8 struct URLRequest; |
| 9 |
| 10 [Native] |
| 11 struct URLResponseHead; |
| 12 |
| 13 [Native] |
| 14 struct URLLoaderStatus; |
| 15 |
| 16 interface URLLoader { |
| 17 // Starts loading the given |request|. |client|'s method will be called when |
| 18 // certain events related to that loading (e.g., response arrival) happen. |
| 19 // |request_id| is for compatibility with the existing Chrome IPC. |
| 20 Start(int32 request_id, |
| 21 URLRequest request, |
| 22 URLLoaderClient client); |
| 23 |
| 24 // If the request passed to |Start| had |auto_follow_redirects| set to false, |
| 25 // then upon receiving an URLResponse with a non-NULL |redirect_url| field, |
| 26 // |FollowRedirect| may be called to load the URL indicated by the redirect. |
| 27 FollowRedirect(); |
| 28 |
| 29 // Cancels the request. The service will cancel loading, but there may be some |
| 30 // time lag and it is possible that the client gets some notification after |
| 31 // calling this method for a while. |
| 32 Cancel(); |
| 33 }; |
| 34 |
| 35 interface URLLoaderClient { |
| 36 // Called when the response head is received. |
| 37 OnReceiveResponse(URLResponseHead head); |
| 38 |
| 39 // Called when the loader starts loading response body. |
| 40 OnStartLoadingResponseBody(handle<data_pipe_consumer> body); |
| 41 |
| 42 // Called when the loading completes. No notification will be dispatched for |
| 43 // this client after this message arrives. |
| 44 OnComplete(URLLoaderStatus completion_status); |
| 45 }; |
| 46 |
OLD | NEW |