Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1279)

Side by Side Diff: content/common/url_loader.mojom

Issue 2503813002: Fix and refactor downloaded file handling in the loading stack (Closed)
Patch Set: -Release Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 content.mojom; 5 module content.mojom;
6 6
7 [Native] 7 [Native]
8 struct URLRequest; 8 struct URLRequest;
9 9
10 [Native] 10 [Native]
11 struct URLResponseHead; 11 struct URLResponseHead;
12 12
13 [Native] 13 [Native]
14 struct URLLoaderStatus; 14 struct URLLoaderStatus;
15 15
16 // Destroying a URLLoader will cancel the associated request. 16 // Destroying a URLLoader will cancel the associated request.
17 interface URLLoader { 17 interface URLLoader {
18 // If the associated request has |auto_follow_redirects| set to false, 18 // If the associated request has |auto_follow_redirects| set to false,
19 // then upon receiving an URLResponse with a non-NULL |redirect_url| field, 19 // then upon receiving an URLResponse with a non-NULL |redirect_url| field,
20 // |FollowRedirect| may be called to load the URL indicated by the redirect. 20 // |FollowRedirect| may be called to load the URL indicated by the redirect.
21 FollowRedirect(); 21 FollowRedirect();
22 }; 22 };
23 23
24 // Represents a temporary file for a download_to_file case of resource loading.
25 // The downloaded file keeps alive until the instance is destroyed.
26 interface DownloadedTempFile {
27 };
28
24 interface URLLoaderClient { 29 interface URLLoaderClient {
25 // Called when the response head is received. 30 // Called when the response head is received. |downloaded_file| is non-null on
26 OnReceiveResponse(URLResponseHead head); 31 // the 'download_to_file' case.
32 OnReceiveResponse(URLResponseHead head, DownloadedTempFile? downloaded_file);
27 33
28 // Called when some data from a resource request has been downloaded to the 34 // Called when some data from a resource request has been downloaded to the
29 // file. This is only called in the 'download_to_file' case and replaces 35 // file. This is only called in the 'download_to_file' case and replaces
30 // OnStartLoadingResponseBody in the call sequence in that case. 36 // OnStartLoadingResponseBody in the call sequence in that case.
31 OnDataDownloaded(int64 data_length, int64 encoded_length); 37 OnDataDownloaded(int64 data_length, int64 encoded_length);
32 38
33 // Called when the loader starts loading response body. 39 // Called when the loader starts loading response body.
34 OnStartLoadingResponseBody(handle<data_pipe_consumer> body); 40 OnStartLoadingResponseBody(handle<data_pipe_consumer> body);
35 41
36 // Called when the loading completes. No notification will be dispatched for 42 // Called when the loading completes. No notification will be dispatched for
37 // this client after this message arrives. 43 // this client after this message arrives.
38 OnComplete(URLLoaderStatus completion_status); 44 OnComplete(URLLoaderStatus completion_status);
39 }; 45 };
40 46
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698