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

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h

Issue 2261103002: Use modified URLRequest::Read() and delegate methods in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@URLRequestRead
Patch Set: comments Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NETWOR K_DELEGATE_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NETWOR K_DELEGATE_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NETWOR K_DELEGATE_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NETWOR K_DELEGATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // some information like the socket address is not available. 109 // some information like the socket address is not available.
110 void OnCompletedInternal(net::URLRequest* request, 110 void OnCompletedInternal(net::URLRequest* request,
111 bool started) override; 111 bool started) override;
112 112
113 // Calculates actual data usage that went over the network at the HTTP layer 113 // Calculates actual data usage that went over the network at the HTTP layer
114 // (e.g. not including network layer overhead) and estimates original data 114 // (e.g. not including network layer overhead) and estimates original data
115 // usage for |request|. Passing in -1 for |original_content_length| indicates 115 // usage for |request|. Passing in -1 for |original_content_length| indicates
116 // that the original content length of the response could not be determined. 116 // that the original content length of the response could not be determined.
117 void CalculateAndRecordDataUsage(const net::URLRequest& request, 117 void CalculateAndRecordDataUsage(const net::URLRequest& request,
118 DataReductionProxyRequestType request_type, 118 DataReductionProxyRequestType request_type,
119 int64_t original_content_length); 119 int64_t original_content_length,
120 int net_error);
120 121
121 // Posts to the UI thread to UpdateContentLengthPrefs in the data reduction 122 // Posts to the UI thread to UpdateContentLengthPrefs in the data reduction
122 // proxy metrics and updates |received_content_length_| and 123 // proxy metrics and updates |received_content_length_| and
123 // |original_content_length_|. 124 // |original_content_length_|.
124 void AccumulateDataUsage(int64_t data_used, 125 void AccumulateDataUsage(int64_t data_used,
125 int64_t original_size, 126 int64_t original_size,
126 DataReductionProxyRequestType request_type, 127 DataReductionProxyRequestType request_type,
127 const scoped_refptr<DataUseGroup>& data_use_group, 128 const scoped_refptr<DataUseGroup>& data_use_group,
128 const std::string& mime_type); 129 const std::string& mime_type);
129 130
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 165
165 const DataReductionProxyConfigurator* configurator_; 166 const DataReductionProxyConfigurator* configurator_;
166 167
167 std::unique_ptr<DataUseGroupProvider> data_use_group_provider_; 168 std::unique_ptr<DataUseGroupProvider> data_use_group_provider_;
168 169
169 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyNetworkDelegate); 170 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyNetworkDelegate);
170 }; 171 };
171 } // namespace data_reduction_proxy 172 } // namespace data_reduction_proxy
172 173
173 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NET WORK_DELEGATE_H_ 174 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NET WORK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698