Chromium Code Reviews| 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_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_ |
| 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 // Returns an vector containing the aggregate received HTTP content in the | 166 // Returns an vector containing the aggregate received HTTP content in the |
| 167 // last |kNumDaysInHistory| days. | 167 // last |kNumDaysInHistory| days. |
| 168 ContentLengthList GetDailyReceivedContentLengths(); | 168 ContentLengthList GetDailyReceivedContentLengths(); |
| 169 | 169 |
| 170 // net::URLFetcherDelegate: | 170 // net::URLFetcherDelegate: |
| 171 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 171 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| 172 | 172 |
| 173 protected: | 173 protected: |
| 174 void InitPrefMembers(); | 174 void InitPrefMembers(); |
| 175 | 175 |
| 176 // Returns a fetcher for the probe to check if OK to use SPDY. | |
|
marq (ping after 24h)
2014/06/16 17:23:35
This probe checks for carrier blocking, right? Not
bengr
2014/06/17 03:42:09
We've considered reasons other than carrier blocki
| |
| 176 virtual net::URLFetcher* GetURLFetcher(); | 177 virtual net::URLFetcher* GetURLFetcher(); |
| 177 | 178 |
| 179 // Returns a fetcher to warm up the connection to the data reduction proxy. | |
| 180 virtual net::URLFetcher* GetURLFetcherForWarmup(); | |
| 181 | |
| 178 // Virtualized for unit test support. | 182 // Virtualized for unit test support. |
| 179 virtual PrefService* GetOriginalProfilePrefs(); | 183 virtual PrefService* GetOriginalProfilePrefs(); |
| 180 virtual PrefService* GetLocalStatePrefs(); | 184 virtual PrefService* GetLocalStatePrefs(); |
| 181 | 185 |
| 182 void GetContentLengths(unsigned int days, | 186 void GetContentLengths(unsigned int days, |
| 183 int64* original_content_length, | 187 int64* original_content_length, |
| 184 int64* received_content_length, | 188 int64* received_content_length, |
| 185 int64* last_update_time); | 189 int64* last_update_time); |
| 186 ContentLengthList GetDailyContentLengths(const char* pref_name); | 190 ContentLengthList GetDailyContentLengths(const char* pref_name); |
| 187 | 191 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 266 | 270 |
| 267 void ResetDataReductionStatistics(); | 271 void ResetDataReductionStatistics(); |
| 268 | 272 |
| 269 void MaybeActivateDataReductionProxy(bool at_startup); | 273 void MaybeActivateDataReductionProxy(bool at_startup); |
| 270 | 274 |
| 271 // Requests the proxy probe URL, if one is set. If unable to do so, disables | 275 // Requests the proxy probe URL, if one is set. If unable to do so, disables |
| 272 // the proxy, if enabled. Otherwise enables the proxy if disabled by a probe | 276 // the proxy, if enabled. Otherwise enables the proxy if disabled by a probe |
| 273 // failure. | 277 // failure. |
| 274 void ProbeWhetherDataReductionProxyIsAvailable(); | 278 void ProbeWhetherDataReductionProxyIsAvailable(); |
| 275 | 279 |
| 280 // Warms the connection to the data reduction proxy. | |
| 281 void WarmProxyConnection(); | |
| 282 | |
| 283 // Generic method to get a URL fetcher. | |
| 284 net::URLFetcher* GetBaseURLFetcher(const GURL& gurl, int load_flags); | |
| 285 | |
| 276 // Returns a UTF16 string that's the hash of the configured authentication | 286 // Returns a UTF16 string that's the hash of the configured authentication |
| 277 // |key| and |salt|. Returns an empty UTF16 string if no key is configured or | 287 // |key| and |salt|. Returns an empty UTF16 string if no key is configured or |
| 278 // the data reduction proxy feature isn't available. | 288 // the data reduction proxy feature isn't available. |
| 279 static base::string16 AuthHashForSalt(int64 salt, | 289 static base::string16 AuthHashForSalt(int64 salt, |
| 280 const std::string& key); | 290 const std::string& key); |
| 281 | 291 |
| 282 std::string key_; | 292 std::string key_; |
| 283 bool restricted_by_carrier_; | 293 bool restricted_by_carrier_; |
| 284 bool enabled_by_user_; | 294 bool enabled_by_user_; |
| 285 | 295 |
| 286 scoped_ptr<net::URLFetcher> fetcher_; | 296 scoped_ptr<net::URLFetcher> fetcher_; |
|
marq (ping after 24h)
2014/06/16 17:23:35
Rename to (e.g.) availabilty_check_fetcher_
| |
| 297 scoped_ptr<net::URLFetcher> warmup_fetcher_; | |
| 298 | |
| 287 BooleanPrefMember spdy_proxy_auth_enabled_; | 299 BooleanPrefMember spdy_proxy_auth_enabled_; |
| 288 BooleanPrefMember data_reduction_proxy_alternative_enabled_; | 300 BooleanPrefMember data_reduction_proxy_alternative_enabled_; |
| 289 | 301 |
| 290 PrefService* prefs_; | 302 PrefService* prefs_; |
| 291 PrefService* local_state_prefs_; | 303 PrefService* local_state_prefs_; |
| 292 | 304 |
| 293 net::URLRequestContextGetter* url_request_context_getter_; | 305 net::URLRequestContextGetter* url_request_context_getter_; |
| 294 | 306 |
| 295 scoped_ptr<DataReductionProxyConfigurator> configurator_; | 307 scoped_ptr<DataReductionProxyConfigurator> configurator_; |
| 296 | 308 |
| 297 base::ThreadChecker thread_checker_; | 309 base::ThreadChecker thread_checker_; |
| 298 | 310 |
| 299 scoped_ptr<DataReductionProxyParams> params_; | 311 scoped_ptr<DataReductionProxyParams> params_; |
| 300 | 312 |
| 301 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); | 313 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); |
| 302 }; | 314 }; |
| 303 | 315 |
| 304 } // namespace data_reduction_proxy | 316 } // namespace data_reduction_proxy |
| 305 | 317 |
| 306 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS _H_ | 318 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS _H_ |
| OLD | NEW |