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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/io_thread.h
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index f57bc395a0eb16e6b0e6966ac96c5461a152ea8d..79478046277be138a1ec696f440f089248864866 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -39,6 +39,7 @@ class CommandLine;
#if defined(OS_ANDROID)
namespace chrome {
namespace android {
+class DataUseTabModel;
class ExternalDataUseObserver;
}
}
@@ -267,9 +268,13 @@ class IOThread : public content::BrowserThreadDelegate {
static bool ShouldEnableQuicForDataReductionProxy();
#if defined(OS_ANDROID)
-chrome::android::ExternalDataUseObserver* external_data_use_observer() const {
- return external_data_use_observer_.get();
-}
+ chrome::android::ExternalDataUseObserver* external_data_use_observer() const {
+ return external_data_use_observer_.get();
+ }
+
+ 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
+ return data_use_tab_model_;
+ }
#endif // defined(OS_ANDROID)
private:
@@ -539,6 +544,8 @@ chrome::android::ExternalDataUseObserver* external_data_use_observer() const {
#if defined(OS_ANDROID)
scoped_ptr<chrome::android::ExternalDataUseObserver>
external_data_use_observer_;
+ // WeakPtr to DataUseTabModel to be used on IO thread.
+ base::WeakPtr<chrome::android::DataUseTabModel> data_use_tab_model_;
#endif // defined(OS_ANDROID)
const base::TimeTicks creation_time_;

Powered by Google App Engine
This is Rietveld 408576698