OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_IO_THREAD_H_ | 5 #ifndef CHROME_BROWSER_IO_THREAD_H_ |
6 #define CHROME_BROWSER_IO_THREAD_H_ | 6 #define CHROME_BROWSER_IO_THREAD_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 21 matching lines...) Expand all Loading... |
32 class PrefRegistrySimple; | 32 class PrefRegistrySimple; |
33 class SystemURLRequestContextGetter; | 33 class SystemURLRequestContextGetter; |
34 | 34 |
35 namespace base { | 35 namespace base { |
36 class CommandLine; | 36 class CommandLine; |
37 } | 37 } |
38 | 38 |
39 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
40 namespace chrome { | 40 namespace chrome { |
41 namespace android { | 41 namespace android { |
| 42 class DataUseTabModel; |
42 class ExternalDataUseObserver; | 43 class ExternalDataUseObserver; |
43 } | 44 } |
44 } | 45 } |
45 #endif // defined(OS_ANDROID) | 46 #endif // defined(OS_ANDROID) |
46 | 47 |
47 namespace chrome_browser_net { | 48 namespace chrome_browser_net { |
48 class DnsProbeService; | 49 class DnsProbeService; |
49 } | 50 } |
50 | 51 |
51 namespace extensions { | 52 namespace extensions { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 data_usage::DataUseAggregator* data_use_aggregator() const; | 264 data_usage::DataUseAggregator* data_use_aggregator() const; |
264 | 265 |
265 // Returns true if QUIC should be enabled for data reduction proxy, either as | 266 // Returns true if QUIC should be enabled for data reduction proxy, either as |
266 // a result of a field trial or a command line flag. | 267 // a result of a field trial or a command line flag. |
267 static bool ShouldEnableQuicForDataReductionProxy(); | 268 static bool ShouldEnableQuicForDataReductionProxy(); |
268 | 269 |
269 #if defined(OS_ANDROID) | 270 #if defined(OS_ANDROID) |
270 chrome::android::ExternalDataUseObserver* external_data_use_observer() const { | 271 chrome::android::ExternalDataUseObserver* external_data_use_observer() const { |
271 return external_data_use_observer_.get(); | 272 return external_data_use_observer_.get(); |
272 } | 273 } |
| 274 base::WeakPtr<chrome::android::DataUseTabModel> data_use_tab_model() const { |
| 275 return data_use_tab_model_; |
| 276 } |
273 #endif // defined(OS_ANDROID) | 277 #endif // defined(OS_ANDROID) |
274 | 278 |
275 private: | 279 private: |
276 // Map from name to value for all parameters associate with a field trial. | 280 // Map from name to value for all parameters associate with a field trial. |
277 typedef std::map<std::string, std::string> VariationParameters; | 281 typedef std::map<std::string, std::string> VariationParameters; |
278 | 282 |
279 // Provide SystemURLRequestContextGetter with access to | 283 // Provide SystemURLRequestContextGetter with access to |
280 // InitSystemRequestContext(). | 284 // InitSystemRequestContext(). |
281 friend class SystemURLRequestContextGetter; | 285 friend class SystemURLRequestContextGetter; |
282 | 286 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 // True if QUIC is allowed by policy. | 536 // True if QUIC is allowed by policy. |
533 bool is_quic_allowed_by_policy_; | 537 bool is_quic_allowed_by_policy_; |
534 | 538 |
535 // Global aggregator of data use. It must outlive the | 539 // Global aggregator of data use. It must outlive the |
536 // |system_network_delegate|. | 540 // |system_network_delegate|. |
537 scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator_; | 541 scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator_; |
538 // An external observer of data use. | 542 // An external observer of data use. |
539 #if defined(OS_ANDROID) | 543 #if defined(OS_ANDROID) |
540 scoped_ptr<chrome::android::ExternalDataUseObserver> | 544 scoped_ptr<chrome::android::ExternalDataUseObserver> |
541 external_data_use_observer_; | 545 external_data_use_observer_; |
| 546 // WeakPtr to DataUseTabModel to be used on IO thread. |
| 547 base::WeakPtr<chrome::android::DataUseTabModel> data_use_tab_model_; |
542 #endif // defined(OS_ANDROID) | 548 #endif // defined(OS_ANDROID) |
543 | 549 |
544 const base::TimeTicks creation_time_; | 550 const base::TimeTicks creation_time_; |
545 | 551 |
546 base::WeakPtrFactory<IOThread> weak_factory_; | 552 base::WeakPtrFactory<IOThread> weak_factory_; |
547 | 553 |
548 DISALLOW_COPY_AND_ASSIGN(IOThread); | 554 DISALLOW_COPY_AND_ASSIGN(IOThread); |
549 }; | 555 }; |
550 | 556 |
551 #endif // CHROME_BROWSER_IO_THREAD_H_ | 557 #endif // CHROME_BROWSER_IO_THREAD_H_ |
OLD | NEW |