Chromium Code Reviews| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 | 261 |
| 261 base::TimeTicks creation_time() const; | 262 base::TimeTicks creation_time() const; |
| 262 | 263 |
| 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 | |
| 275 base::WeakPtr<chrome::android::DataUseTabModel> data_use_tab_model() const { | |
| 276 return data_use_tab_model_; | |
| 277 } | |
| 273 #endif // defined(OS_ANDROID) | 278 #endif // defined(OS_ANDROID) |
| 274 | 279 |
| 275 private: | 280 private: |
| 276 // Map from name to value for all parameters associate with a field trial. | 281 // Map from name to value for all parameters associate with a field trial. |
| 277 typedef std::map<std::string, std::string> VariationParameters; | 282 typedef std::map<std::string, std::string> VariationParameters; |
| 278 | 283 |
| 279 // Provide SystemURLRequestContextGetter with access to | 284 // Provide SystemURLRequestContextGetter with access to |
| 280 // InitSystemRequestContext(). | 285 // InitSystemRequestContext(). |
| 281 friend class SystemURLRequestContextGetter; | 286 friend class SystemURLRequestContextGetter; |
| 282 | 287 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 532 // True if QUIC is allowed by policy. | 537 // True if QUIC is allowed by policy. |
| 533 bool is_quic_allowed_by_policy_; | 538 bool is_quic_allowed_by_policy_; |
| 534 | 539 |
| 535 // Global aggregator of data use. It must outlive the | 540 // Global aggregator of data use. It must outlive the |
| 536 // |system_network_delegate|. | 541 // |system_network_delegate|. |
| 537 scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator_; | 542 scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator_; |
| 538 // An external observer of data use. | 543 // An external observer of data use. |
| 539 #if defined(OS_ANDROID) | 544 #if defined(OS_ANDROID) |
| 540 scoped_ptr<chrome::android::ExternalDataUseObserver> | 545 scoped_ptr<chrome::android::ExternalDataUseObserver> |
| 541 external_data_use_observer_; | 546 external_data_use_observer_; |
| 547 // WeakPtr to DataUseTabModel to be used on IO thread. | |
|
sclittle
2015/11/19 21:53:24
Is there some better way to expose the WeakPtr to
| |
| 548 base::WeakPtr<chrome::android::DataUseTabModel> data_use_tab_model_; | |
| 542 #endif // defined(OS_ANDROID) | 549 #endif // defined(OS_ANDROID) |
| 543 | 550 |
| 544 const base::TimeTicks creation_time_; | 551 const base::TimeTicks creation_time_; |
| 545 | 552 |
| 546 base::WeakPtrFactory<IOThread> weak_factory_; | 553 base::WeakPtrFactory<IOThread> weak_factory_; |
| 547 | 554 |
| 548 DISALLOW_COPY_AND_ASSIGN(IOThread); | 555 DISALLOW_COPY_AND_ASSIGN(IOThread); |
| 549 }; | 556 }; |
| 550 | 557 |
| 551 #endif // CHROME_BROWSER_IO_THREAD_H_ | 558 #endif // CHROME_BROWSER_IO_THREAD_H_ |
| OLD | NEW |