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

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

Issue 2574143003: Implement upload progress handling in Mojo loading (Closed)
Patch Set: update TestExpectations 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 OnTransferSizeUpdated(int32_t transfer_size_diff) override; 66 void OnTransferSizeUpdated(int32_t transfer_size_diff) override;
64 void OnStartLoadingResponseBody( 67 void OnStartLoadingResponseBody(
65 mojo::ScopedDataPipeConsumerHandle body) override; 68 mojo::ScopedDataPipeConsumerHandle body) override;
66 void OnComplete(const ResourceRequestCompletionStatus& status) override; 69 void OnComplete(const ResourceRequestCompletionStatus& status) override;
67 70
68 private: 71 private:
69 void Dispatch(const IPC::Message& message); 72 void Dispatch(const IPC::Message& message);
70 73
71 mojo::AssociatedBinding<mojom::URLLoaderClient> binding_; 74 mojo::AssociatedBinding<mojom::URLLoaderClient> binding_;
72 scoped_refptr<URLResponseBodyConsumer> body_consumer_; 75 scoped_refptr<URLResponseBodyConsumer> body_consumer_;
73 mojom::DownloadedTempFilePtr downloaded_file_; 76 mojom::DownloadedTempFilePtr downloaded_file_;
74 std::vector<IPC::Message> deferred_messages_; 77 std::vector<IPC::Message> deferred_messages_;
75 const int request_id_; 78 const int request_id_;
76 bool has_received_response_ = false; 79 bool has_received_response_ = false;
77 bool is_deferred_ = false; 80 bool is_deferred_ = false;
78 int32_t accumulated_transfer_size_diff_during_deferred_ = 0; 81 int32_t accumulated_transfer_size_diff_during_deferred_ = 0;
79 ResourceDispatcher* const resource_dispatcher_; 82 ResourceDispatcher* const resource_dispatcher_;
80 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 83 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
81 base::WeakPtrFactory<URLLoaderClientImpl> weak_factory_; 84 base::WeakPtrFactory<URLLoaderClientImpl> weak_factory_;
82 }; 85 };
83 86
84 } // namespace content 87 } // namespace content
85 88
86 #endif // CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_ 89 #endif // CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698