OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CONFIG
_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG
_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG
_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG
_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // This object lives on the IO thread and all of its methods are expected to be | 87 // This object lives on the IO thread and all of its methods are expected to be |
88 // called from there. | 88 // called from there. |
89 class DataReductionProxyConfig | 89 class DataReductionProxyConfig |
90 : public net::NetworkChangeNotifier::IPAddressObserver { | 90 : public net::NetworkChangeNotifier::IPAddressObserver { |
91 public: | 91 public: |
92 // The caller must ensure that all parameters remain alive for the lifetime | 92 // The caller must ensure that all parameters remain alive for the lifetime |
93 // of the |DataReductionProxyConfig| instance, with the exception of | 93 // of the |DataReductionProxyConfig| instance, with the exception of |
94 // |config_values| which is owned by |this|. |event_creator| is used for | 94 // |config_values| which is owned by |this|. |event_creator| is used for |
95 // logging the start and end of a secure proxy check; |net_log| is used to | 95 // logging the start and end of a secure proxy check; |net_log| is used to |
96 // create a net::NetLogWithSource for correlating the start and end of the | 96 // create a net::NetLogWithSource for correlating the start and end of the |
97 // check. | 97 // check. |config_values| contains the Data Reduction Proxy configuration |
98 // |config_values| contains the Data Reduction Proxy configuration values. | 98 // values. |configurator| is the target for a configuration update. |
99 // |configurator| is the target for a configuration update. | |
100 DataReductionProxyConfig( | 99 DataReductionProxyConfig( |
101 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 100 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
102 net::NetLog* net_log, | 101 net::NetLog* net_log, |
103 std::unique_ptr<DataReductionProxyConfigValues> config_values, | 102 std::unique_ptr<DataReductionProxyConfigValues> config_values, |
104 DataReductionProxyConfigurator* configurator, | 103 DataReductionProxyConfigurator* configurator, |
105 DataReductionProxyEventCreator* event_creator); | 104 DataReductionProxyEventCreator* event_creator); |
106 ~DataReductionProxyConfig() override; | 105 ~DataReductionProxyConfig() override; |
107 | 106 |
108 // Performs initialization on the IO thread. | 107 // Performs initialization on the IO thread. |
109 void InitializeOnIOThread(const scoped_refptr<net::URLRequestContextGetter>& | 108 void InitializeOnIOThread(const scoped_refptr<net::URLRequestContextGetter>& |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 bool unreachable_; | 321 bool unreachable_; |
323 bool enabled_by_user_; | 322 bool enabled_by_user_; |
324 | 323 |
325 // Contains the configuration data being used. | 324 // Contains the configuration data being used. |
326 std::unique_ptr<DataReductionProxyConfigValues> config_values_; | 325 std::unique_ptr<DataReductionProxyConfigValues> config_values_; |
327 | 326 |
328 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 327 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
329 | 328 |
330 // The caller must ensure that the |net_log_|, if set, outlives this instance. | 329 // The caller must ensure that the |net_log_|, if set, outlives this instance. |
331 // It is used to create new instances of |net_log_with_source_| on secure | 330 // It is used to create new instances of |net_log_with_source_| on secure |
332 // proxy | 331 // proxy checks. |net_log_with_source_| permits the correlation of the begin |
333 // checks. |net_log_with_source_| permits the correlation of the begin and end | 332 // and end phases of a given secure proxy check, and a new one is created for |
334 // phases of a given secure proxy check, and a new one is created for each | 333 // each secure proxy check (with |net_log_| as a parameter). |
335 // secure proxy check (with |net_log_| as a parameter). | |
336 net::NetLog* net_log_; | 334 net::NetLog* net_log_; |
337 net::NetLogWithSource net_log_with_source_; | 335 net::NetLogWithSource net_log_with_source_; |
338 | 336 |
339 // The caller must ensure that the |configurator_| outlives this instance. | 337 // The caller must ensure that the |configurator_| outlives this instance. |
340 DataReductionProxyConfigurator* configurator_; | 338 DataReductionProxyConfigurator* configurator_; |
341 | 339 |
342 // The caller must ensure that the |event_creator_| outlives this instance. | 340 // The caller must ensure that the |event_creator_| outlives this instance. |
343 DataReductionProxyEventCreator* event_creator_; | 341 DataReductionProxyEventCreator* event_creator_; |
344 | 342 |
345 // Enforce usage on the IO thread. | 343 // Enforce usage on the IO thread. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 std::vector<base::TimeDelta> lofi_accuracy_recording_intervals_; | 388 std::vector<base::TimeDelta> lofi_accuracy_recording_intervals_; |
391 | 389 |
392 base::WeakPtrFactory<DataReductionProxyConfig> weak_factory_; | 390 base::WeakPtrFactory<DataReductionProxyConfig> weak_factory_; |
393 | 391 |
394 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfig); | 392 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfig); |
395 }; | 393 }; |
396 | 394 |
397 } // namespace data_reduction_proxy | 395 } // namespace data_reduction_proxy |
398 | 396 |
399 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CON
FIG_H_ | 397 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CON
FIG_H_ |
OLD | NEW |