Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1165)

Side by Side Diff: chrome/browser/io_thread.h

Issue 1443683002: Notify DataUseTabModel of navigations and tab closures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, addressed comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 {
sclittle 2015/11/18 21:42:04 Why expose this here? Why not just call external_d
tbansal1 2015/11/19 00:47:07 GetWeakPtr() needs to be called on IO thread. prof
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
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.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698