OLD | NEW |
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // DataReductionProxyData from the URLRequest. | 108 // DataReductionProxyData from the URLRequest. |
109 void OnBeforeRedirectInternal(net::URLRequest* request, | 109 void OnBeforeRedirectInternal(net::URLRequest* request, |
110 const GURL& new_location) override; | 110 const GURL& new_location) override; |
111 | 111 |
112 // Indicates that the URL request has been completed or failed. | 112 // Indicates that the URL request has been completed or failed. |
113 // |started| indicates whether the request has been started. If false, | 113 // |started| indicates whether the request has been started. If false, |
114 // some information like the socket address is not available. | 114 // some information like the socket address is not available. |
115 void OnCompletedInternal(net::URLRequest* request, | 115 void OnCompletedInternal(net::URLRequest* request, |
116 bool started) override; | 116 bool started) override; |
117 | 117 |
| 118 // Checks if a LoFi or Lite Pages response was received and sets the state on |
| 119 // DataReductionProxyData for |request|. |
| 120 void OnHeadersReceivedInternal( |
| 121 net::URLRequest* request, |
| 122 const net::CompletionCallback& callback, |
| 123 const net::HttpResponseHeaders* original_response_headers, |
| 124 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
| 125 GURL* allowed_unsafe_redirect_url) override; |
| 126 |
118 // Calculates actual data usage that went over the network at the HTTP layer | 127 // Calculates actual data usage that went over the network at the HTTP layer |
119 // (e.g. not including network layer overhead) and estimates original data | 128 // (e.g. not including network layer overhead) and estimates original data |
120 // usage for |request|. | 129 // usage for |request|. |
121 void CalculateAndRecordDataUsage(const net::URLRequest& request, | 130 void CalculateAndRecordDataUsage(const net::URLRequest& request, |
122 DataReductionProxyRequestType request_type); | 131 DataReductionProxyRequestType request_type); |
123 | 132 |
124 // Posts to the UI thread to UpdateContentLengthPrefs in the data reduction | 133 // Posts to the UI thread to UpdateContentLengthPrefs in the data reduction |
125 // proxy metrics and updates |received_content_length_| and | 134 // proxy metrics and updates |received_content_length_| and |
126 // |original_content_length_|. | 135 // |original_content_length_|. |
127 void AccumulateDataUsage(int64_t data_used, | 136 void AccumulateDataUsage(int64_t data_used, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 179 |
171 std::unique_ptr<DataUseGroupProvider> data_use_group_provider_; | 180 std::unique_ptr<DataUseGroupProvider> data_use_group_provider_; |
172 | 181 |
173 base::ThreadChecker thread_checker_; | 182 base::ThreadChecker thread_checker_; |
174 | 183 |
175 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyNetworkDelegate); | 184 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyNetworkDelegate); |
176 }; | 185 }; |
177 } // namespace data_reduction_proxy | 186 } // namespace data_reduction_proxy |
178 | 187 |
179 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NET
WORK_DELEGATE_H_ | 188 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NET
WORK_DELEGATE_H_ |
OLD | NEW |