Index: content/common/url_loader.mojom |
diff --git a/content/common/url_loader.mojom b/content/common/url_loader.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ac7a307681ce855480b273f46aca00836df053af |
--- /dev/null |
+++ b/content/common/url_loader.mojom |
@@ -0,0 +1,45 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+module content.mojom; |
+ |
+[Native] |
+struct URLRequest; |
+ |
+[Native] |
+struct URLResponseHead; |
+ |
+[Native] |
+struct URLLoaderStatus; |
+ |
+interface URLLoader { |
+ // 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
|
+ // |response| to determine if the request resulted in an error, was |
+ // redirected, or has a response body to be consumed. |
+ // |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.
|
+ 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.
|
+ 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
|
+ URLLoaderClient client); |
+ |
+ // If the request passed to |Load| had |auto_follow_redirects| set to false, |
+ // then upon receiving an URLResponse with a non-NULL |redirect_url| field, |
+ // |FollowRedirect| may be called to load the URL indicated by the redirect. |
+ FollowRedirect(); |
+ |
+ // 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?
|
+ Cancel(); |
+}; |
+ |
+interface URLLoaderClient { |
+ // Called when the response head is received. |
+ OnReceiveResponse(URLResponseHead head); |
+ |
+ // Called when the loader starts loading response body. |
+ OnStartLoadingResponseBody(handle<data_pipe_consumer> body); |
+ |
+ // Called when the loading completes. No notification will be dispatched for |
+ // this client after this message arrives. |
+ OnComplete(URLLoaderStatus completion_status); |
+}; |
+ |