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

Unified Diff: chrome/browser/android/data_usage/external_data_use_observer.cc

Issue 2158913002: Make DataUseTabModel and DataUseMatcher more independent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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/android/data_usage/external_data_use_observer.cc
diff --git a/chrome/browser/android/data_usage/external_data_use_observer.cc b/chrome/browser/android/data_usage/external_data_use_observer.cc
index 36d3c860696f824c193bcb56a3c77f97804bc704..02b5fd06603ff5834792b53291363048d571d135 100644
--- a/chrome/browser/android/data_usage/external_data_use_observer.cc
+++ b/chrome/browser/android/data_usage/external_data_use_observer.cc
@@ -6,6 +6,8 @@
#include <utility>
+#include "base/bind.h"
+#include "base/callback.h"
#include "base/containers/hash_tables.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/field_trial.h"
@@ -133,7 +135,12 @@ ExternalDataUseObserver::ExternalDataUseObserver(
const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner)
: data_use_aggregator_(data_use_aggregator),
external_data_use_observer_bridge_(new ExternalDataUseObserverBridge()),
- data_use_tab_model_(new DataUseTabModel()),
+ data_use_tab_model_(new DataUseTabModel(
+ base::Bind(&ExternalDataUseObserverBridge::FetchMatchingRules,
+ base::Unretained(external_data_use_observer_bridge_)),
tbansal1 2016/07/18 17:04:38 Add comment about why it is okay to use base::Unre
Raj 2016/07/19 00:19:02 Done.
+ base::Bind(
+ &ExternalDataUseObserverBridge::ShouldRegisterAsDataUseObserver,
+ base::Unretained(external_data_use_observer_bridge_)))),
last_data_report_submitted_ticks_(base::TimeTicks()),
pending_report_bytes_(0),
ui_task_runner_(ui_task_runner),
@@ -160,8 +167,7 @@ ExternalDataUseObserver::ExternalDataUseObserver(
ui_task_runner_->PostTask(FROM_HERE,
base::Bind(&DataUseTabModel::InitOnUIThread,
tbansal1 2016/07/18 17:04:38 Is it possible that this initialization calls the
Raj 2016/07/19 00:19:02 Removed this. InitOnUIThread() is not needed.
- base::Unretained(data_use_tab_model_),
- external_data_use_observer_bridge_));
+ base::Unretained(data_use_tab_model_)));
// Initialize the ExternalDataUseObserverBridge object. It is okay to use
// base::Unretained here since |external_data_use_observer_bridge_| is owned

Powered by Google App Engine
This is Rietveld 408576698