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

Side by Side Diff: content/child/url_loader_client_impl.h

Issue 2574143003: Implement upload progress handling in Mojo loading (Closed)
Patch Set: +comment Created 3 years, 10 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
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/child/url_loader_client_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_ 5 #ifndef CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_
6 #define CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_ 6 #define CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // Disaptches the messages received after SetDefersLoading is called. 54 // Disaptches the messages received after SetDefersLoading is called.
55 void FlushDeferredMessages(); 55 void FlushDeferredMessages();
56 56
57 // mojom::URLLoaderClient implementation 57 // mojom::URLLoaderClient implementation
58 void OnReceiveResponse( 58 void OnReceiveResponse(
59 const ResourceResponseHead& response_head, 59 const ResourceResponseHead& response_head,
60 mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file) override; 60 mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file) override;
61 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, 61 void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
62 const ResourceResponseHead& response_head) override; 62 const ResourceResponseHead& response_head) override;
63 void OnDataDownloaded(int64_t data_len, int64_t encoded_data_len) override; 63 void OnDataDownloaded(int64_t data_len, int64_t encoded_data_len) override;
64 void OnUploadProgress(int64_t current_position,
65 int64_t total_size,
66 const base::Closure& ack_callback) override;
64 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override; 67 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override;
65 void OnTransferSizeUpdated(int32_t transfer_size_diff) override; 68 void OnTransferSizeUpdated(int32_t transfer_size_diff) override;
66 void OnStartLoadingResponseBody( 69 void OnStartLoadingResponseBody(
67 mojo::ScopedDataPipeConsumerHandle body) override; 70 mojo::ScopedDataPipeConsumerHandle body) override;
68 void OnComplete(const ResourceRequestCompletionStatus& status) override; 71 void OnComplete(const ResourceRequestCompletionStatus& status) override;
69 72
70 private: 73 private:
71 void Dispatch(const IPC::Message& message); 74 void Dispatch(const IPC::Message& message);
72 75
73 mojo::AssociatedBinding<mojom::URLLoaderClient> binding_; 76 mojo::AssociatedBinding<mojom::URLLoaderClient> binding_;
74 scoped_refptr<URLResponseBodyConsumer> body_consumer_; 77 scoped_refptr<URLResponseBodyConsumer> body_consumer_;
75 mojom::DownloadedTempFileAssociatedPtr downloaded_file_; 78 mojom::DownloadedTempFileAssociatedPtr downloaded_file_;
76 std::vector<IPC::Message> deferred_messages_; 79 std::vector<IPC::Message> deferred_messages_;
77 const int request_id_; 80 const int request_id_;
78 bool has_received_response_ = false; 81 bool has_received_response_ = false;
79 bool is_deferred_ = false; 82 bool is_deferred_ = false;
80 int32_t accumulated_transfer_size_diff_during_deferred_ = 0; 83 int32_t accumulated_transfer_size_diff_during_deferred_ = 0;
81 ResourceDispatcher* const resource_dispatcher_; 84 ResourceDispatcher* const resource_dispatcher_;
82 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 85 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
83 base::WeakPtrFactory<URLLoaderClientImpl> weak_factory_; 86 base::WeakPtrFactory<URLLoaderClientImpl> weak_factory_;
84 }; 87 };
85 88
86 } // namespace content 89 } // namespace content
87 90
88 #endif // CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_ 91 #endif // CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_
OLDNEW
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/child/url_loader_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698