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

Unified Diff: chrome/browser/android/data_usage/data_use_tab_model.h

Issue 1772273002: Remove one thread hop while fetching matching rules (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits Created 4 years, 9 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/data_use_tab_model.h
diff --git a/chrome/browser/android/data_usage/data_use_tab_model.h b/chrome/browser/android/data_usage/data_use_tab_model.h
index d1680993d81c0044c69aae61ff4c97c888e62548..2d71ffac0dde7f3d96058f6f58d090ee694ed49b 100644
--- a/chrome/browser/android/data_usage/data_use_tab_model.h
+++ b/chrome/browser/android/data_usage/data_use_tab_model.h
@@ -13,7 +13,6 @@
#include "base/containers/hash_tables.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
-#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
@@ -21,20 +20,19 @@
#include "base/time/time.h"
#include "chrome/browser/android/data_usage/tab_data_use_entry.h"
#include "components/sessions/core/session_id.h"
+#include "url/gurl.h"
namespace base {
class SingleThreadTaskRunner;
class TickClock;
}
-class GURL;
-
namespace chrome {
namespace android {
class DataUseMatcher;
-class ExternalDataUseObserver;
+class ExternalDataUseObserverBridge;
// Models tracking and labeling of data usage within each Tab. Within each tab,
// the model tracks the data use of a sequence of navigations in a "tracking
@@ -85,11 +83,13 @@ class DataUseTabModel {
DataUseTabModel();
- // Initializes |this| on UI thread. |external_data_use_observer| is the weak
- // pointer to ExternalDataUseObserver object that owns |this|.
+ // Initializes |this| on UI thread. |external_data_use_observer_bridge| is the
+ // pointer to ExternalDataUseObserverBridge object. DataUseTabModel and
+ // ExternalDataUseObserverBridge objects are owned by ExternalDataUseObserver
+ // and DataUseTabModel is destroyed first followed by
+ // ExternalDataUseObserverBridge.
void InitOnUIThread(
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
- const base::WeakPtr<ExternalDataUseObserver>& external_data_use_observer);
+ const ExternalDataUseObserverBridge* external_data_use_observer_bridge);
virtual ~DataUseTabModel();

Powered by Google App Engine
This is Rietveld 408576698