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

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

Issue 2574143003: Implement upload progress handling in Mojo loading (Closed)
Patch Set: android build fix 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 #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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
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(const ResourceResponseHead& response_head, 58 void OnReceiveResponse(const ResourceResponseHead& response_head,
59 mojom::DownloadedTempFilePtr downloaded_file) override; 59 mojom::DownloadedTempFilePtr downloaded_file) override;
60 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, 60 void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
61 const ResourceResponseHead& response_head) override; 61 const ResourceResponseHead& response_head) override;
62 void OnDataDownloaded(int64_t data_len, int64_t encoded_data_len) override; 62 void OnDataDownloaded(int64_t data_len, int64_t encoded_data_len) override;
63 void OnUploadProgress(int64_t current_position,
64 int64_t total_size,
65 const base::Closure& ack_callback) override;
63 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override; 66 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override;
64 void OnTransferSizeUpdated(int32_t transfer_size_diff) override; 67 void OnTransferSizeUpdated(int32_t transfer_size_diff) override;
65 void OnStartLoadingResponseBody( 68 void OnStartLoadingResponseBody(
66 mojo::ScopedDataPipeConsumerHandle body) override; 69 mojo::ScopedDataPipeConsumerHandle body) override;
67 void OnComplete(const ResourceRequestCompletionStatus& status) override; 70 void OnComplete(const ResourceRequestCompletionStatus& status) override;
68 71
69 private: 72 private:
70 void Dispatch(const IPC::Message& message); 73 void Dispatch(const IPC::Message& message);
71 74
72 mojo::AssociatedBinding<mojom::URLLoaderClient> binding_; 75 mojo::AssociatedBinding<mojom::URLLoaderClient> binding_;
73 scoped_refptr<URLResponseBodyConsumer> body_consumer_; 76 scoped_refptr<URLResponseBodyConsumer> body_consumer_;
74 mojom::DownloadedTempFilePtr downloaded_file_; 77 mojom::DownloadedTempFilePtr downloaded_file_;
75 std::vector<IPC::Message> deferred_messages_; 78 std::vector<IPC::Message> deferred_messages_;
76 const int request_id_; 79 const int request_id_;
77 bool has_received_response_ = false; 80 bool has_received_response_ = false;
78 bool is_deferred_ = false; 81 bool is_deferred_ = false;
79 int32_t accumulated_transfer_size_diff_during_deferred_ = 0; 82 int32_t accumulated_transfer_size_diff_during_deferred_ = 0;
80 ResourceDispatcher* const resource_dispatcher_; 83 ResourceDispatcher* const resource_dispatcher_;
81 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 84 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
82 base::WeakPtrFactory<URLLoaderClientImpl> weak_factory_; 85 base::WeakPtrFactory<URLLoaderClientImpl> weak_factory_;
83 }; 86 };
84 87
85 } // namespace content 88 } // namespace content
86 89
87 #endif // CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_ 90 #endif // CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698