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 // Loads the given |request|, asynchronously producing |response|. Consult | |
mmenke
2016/05/25 16:17:20
|response|? I don't see anything with that name h
yhirano
2016/05/26 15:42:44
Ah, sorry, I forgot to update the description when
| |
18 // |response| to determine if the request resulted in an error, was | |
19 // redirected, or has a response body to be consumed. | |
20 // |request_id| is for compatibility with the existing ChromeIPC. | |
mmenke
2016/05/25 16:17:20
I don't think ChromeIPC is one word?
yhirano
2016/05/26 15:42:44
Done.
| |
21 Load(int32 request_id, | |
mmenke
2016/05/25 16:17:20
Is there a reason this is "Load" and not "Start".
yhirano
2016/05/26 15:42:44
Done.
| |
22 URLRequest request, | |
mmenke
2016/05/25 16:17:20
Hrm...I'm not sure the world can handle yet anothe
yhirano
2016/05/26 15:42:44
I'm not particularly fond of names in this file bu
| |
23 URLLoaderClient client); | |
24 | |
25 // If the request passed to |Load| had |auto_follow_redirects| set to false, | |
26 // then upon receiving an URLResponse with a non-NULL |redirect_url| field, | |
27 // |FollowRedirect| may be called to load the URL indicated by the redirect. | |
28 FollowRedirect(); | |
29 | |
30 // Cancels the request. | |
mmenke
2016/05/25 16:17:20
Can we still get data after calling Cancel, or doe
yhirano
2016/05/26 15:42:44
I added some comments. Is it clear now?
| |
31 Cancel(); | |
32 }; | |
33 | |
34 interface URLLoaderClient { | |
35 // Called when the response head is received. | |
36 OnReceiveResponse(URLResponseHead head); | |
37 | |
38 // Called when the loader starts loading response body. | |
39 OnStartLoadingResponseBody(handle<data_pipe_consumer> body); | |
40 | |
41 // Called when the loading completes. No notification will be dispatched for | |
42 // this client after this message arrives. | |
43 OnComplete(URLLoaderStatus completion_status); | |
44 }; | |
45 | |
OLD | NEW |