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

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

Issue 2574143003: Implement upload progress handling in Mojo loading (Closed)
Patch Set: +comment Created 3 years, 11 months 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]
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // call FollowRedirect or cancel the request. 42 // call FollowRedirect or cancel the request.
43 OnReceiveRedirect(URLRequestRedirectInfo redirect_info, URLResponseHead head); 43 OnReceiveRedirect(URLRequestRedirectInfo redirect_info, URLResponseHead head);
44 44
45 // Called when some data from a resource request has been downloaded to the 45 // Called when some data from a resource request has been downloaded to the
46 // file. This is only called in the 'download_to_file' case and replaces 46 // file. This is only called in the 'download_to_file' case and replaces
47 // OnStartLoadingResponseBody in the call sequence in that case. 47 // OnStartLoadingResponseBody in the call sequence in that case.
48 // TODO(yhirano): Remove |encoded_length| and use OnTransferSizeUpdated 48 // TODO(yhirano): Remove |encoded_length| and use OnTransferSizeUpdated
49 // instead. 49 // instead.
50 OnDataDownloaded(int64 data_length, int64 encoded_length); 50 OnDataDownloaded(int64 data_length, int64 encoded_length);
51 51
52 // Called when the service made some progress on the file upload. This is
53 // called only when the request has an upload data.
54 // The implementation should call the response closure when the client is
55 // ready to receive the next upload progress.
56 OnUploadProgress(int64 current_position, int64 total_size) => ();
57
52 // Called when cached metadata from a resource request is ready. 58 // Called when cached metadata from a resource request is ready.
53 OnReceiveCachedMetadata(array<uint8> data); 59 OnReceiveCachedMetadata(array<uint8> data);
54 60
55 // Called when the transfer size is updated. This is only called if 61 // Called when the transfer size is updated. This is only called if
56 // |report_raw_headers| is set and |download_to_file| is unset in the request. 62 // |report_raw_headers| is set and |download_to_file| is unset in the request.
57 // The transfer size is the length of the response (including both headers 63 // The transfer size is the length of the response (including both headers
58 // and the body) over the network. |transfer_size_diff| is the difference from 64 // and the body) over the network. |transfer_size_diff| is the difference from
59 // the value previously reported one (including the one in OnReceiveResponse 65 // the value previously reported one (including the one in OnReceiveResponse
60 // and OnReceiveRedirect). It must be positive. 66 // and OnReceiveRedirect). It must be positive.
61 // TODO(yhirano): Dispatch this notification even when |download_to_file| is 67 // TODO(yhirano): Dispatch this notification even when |download_to_file| is
62 // set. 68 // set.
63 // TODO(yhirano): Consider using an unsigned type. 69 // TODO(yhirano): Consider using an unsigned type.
64 OnTransferSizeUpdated(int32 transfer_size_diff); 70 OnTransferSizeUpdated(int32 transfer_size_diff);
65 71
66 // Called when the loader starts loading response body. This is called after 72 // Called when the loader starts loading response body. This is called after
67 // OnReceiveResponse is called. 73 // OnReceiveResponse is called.
68 OnStartLoadingResponseBody(handle<data_pipe_consumer> body); 74 OnStartLoadingResponseBody(handle<data_pipe_consumer> body);
69 75
70 // Called when the loading completes. No notification will be dispatched for 76 // Called when the loading completes. No notification will be dispatched for
71 // this client after this message arrives. 77 // this client after this message arrives.
72 OnComplete(URLLoaderStatus completion_status); 78 OnComplete(URLLoaderStatus completion_status);
73 }; 79 };
74 80
OLDNEW
« no previous file with comments | « content/child/url_loader_client_impl.cc ('k') | content/renderer/service_worker/service_worker_context_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698