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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 // Central point for holding the Data Reduction Proxy configuration. | 86 // Central point for holding the Data Reduction Proxy configuration. |
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::BoundNetLog for correlating the start and end of the check. | 96 // create a net::NetLogWithSource for correlating the start and end of the |
97 // check. | |
sdefresne
2016/09/22 13:27:18
nit: can you rewrap this comment?
| |
97 // |config_values| contains the Data Reduction Proxy configuration values. | 98 // |config_values| contains the Data Reduction Proxy configuration values. |
98 // |configurator| is the target for a configuration update. | 99 // |configurator| is the target for a configuration update. |
99 DataReductionProxyConfig( | 100 DataReductionProxyConfig( |
100 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 101 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
101 net::NetLog* net_log, | 102 net::NetLog* net_log, |
102 std::unique_ptr<DataReductionProxyConfigValues> config_values, | 103 std::unique_ptr<DataReductionProxyConfigValues> config_values, |
103 DataReductionProxyConfigurator* configurator, | 104 DataReductionProxyConfigurator* configurator, |
104 DataReductionProxyEventCreator* event_creator); | 105 DataReductionProxyEventCreator* event_creator); |
105 ~DataReductionProxyConfig() override; | 106 ~DataReductionProxyConfig() override; |
106 | 107 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 | 321 |
321 bool unreachable_; | 322 bool unreachable_; |
322 bool enabled_by_user_; | 323 bool enabled_by_user_; |
323 | 324 |
324 // Contains the configuration data being used. | 325 // Contains the configuration data being used. |
325 std::unique_ptr<DataReductionProxyConfigValues> config_values_; | 326 std::unique_ptr<DataReductionProxyConfigValues> config_values_; |
326 | 327 |
327 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 328 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
328 | 329 |
329 // The caller must ensure that the |net_log_|, if set, outlives this instance. | 330 // The caller must ensure that the |net_log_|, if set, outlives this instance. |
330 // It is used to create new instances of |bound_net_log_| on secure proxy | 331 // It is used to create new instances of |net_log_with_source_| on secure |
331 // checks. |bound_net_log_| permits the correlation of the begin and end | 332 // proxy |
sdefresne
2016/09/22 13:27:18
nit: can you rewrap this comment?
| |
333 // checks. |net_log_with_source_| permits the correlation of the begin and end | |
332 // phases of a given secure proxy check, and a new one is created for each | 334 // phases of a given secure proxy check, and a new one is created for each |
333 // secure proxy check (with |net_log_| as a parameter). | 335 // secure proxy check (with |net_log_| as a parameter). |
334 net::NetLog* net_log_; | 336 net::NetLog* net_log_; |
335 net::BoundNetLog bound_net_log_; | 337 net::NetLogWithSource net_log_with_source_; |
336 | 338 |
337 // The caller must ensure that the |configurator_| outlives this instance. | 339 // The caller must ensure that the |configurator_| outlives this instance. |
338 DataReductionProxyConfigurator* configurator_; | 340 DataReductionProxyConfigurator* configurator_; |
339 | 341 |
340 // The caller must ensure that the |event_creator_| outlives this instance. | 342 // The caller must ensure that the |event_creator_| outlives this instance. |
341 DataReductionProxyEventCreator* event_creator_; | 343 DataReductionProxyEventCreator* event_creator_; |
342 | 344 |
343 // Enforce usage on the IO thread. | 345 // Enforce usage on the IO thread. |
344 base::ThreadChecker thread_checker_; | 346 base::ThreadChecker thread_checker_; |
345 | 347 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
388 std::vector<base::TimeDelta> lofi_accuracy_recording_intervals_; | 390 std::vector<base::TimeDelta> lofi_accuracy_recording_intervals_; |
389 | 391 |
390 base::WeakPtrFactory<DataReductionProxyConfig> weak_factory_; | 392 base::WeakPtrFactory<DataReductionProxyConfig> weak_factory_; |
391 | 393 |
392 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfig); | 394 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfig); |
393 }; | 395 }; |
394 | 396 |
395 } // namespace data_reduction_proxy | 397 } // namespace data_reduction_proxy |
396 | 398 |
397 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CON FIG_H_ | 399 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CON FIG_H_ |
OLD | NEW |