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

Unified Diff: components/precache/content/precache_manager.h

Issue 2562573003: Create a synthetic field trial for precache (Closed)
Patch Set: Created 4 years 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: components/precache/content/precache_manager.h
diff --git a/components/precache/content/precache_manager.h b/components/precache/content/precache_manager.h
index e6bcc8094ab5e9a9bd5abed331d49c997cb20e85..84bb58a46b8085ba25fa2ea2002291516a58da89 100644
--- a/components/precache/content/precache_manager.h
+++ b/components/precache/content/precache_manager.h
@@ -70,7 +70,9 @@ class PrecacheManager : public KeyedService,
const syncer::SyncService* const sync_service,
const history::HistoryService* const history_service,
const base::FilePath& db_path,
- std::unique_ptr<PrecacheDatabase> precache_database);
+ std::unique_ptr<PrecacheDatabase> precache_database,
+ const base::Callback<void(const base::Time&)>&
+ register_synthetic_field_trial_callback);
~PrecacheManager() override;
// Returns true if the client is in the experiment group -- that is,
@@ -142,6 +144,11 @@ class PrecacheManager : public KeyedService,
// From PrecacheFetcher::PrecacheDelegate.
void OnDone() override;
+ // Registers the precache synthetic field trial for users whom the precache
+ // task was run recently. |last_precache_time| is the last time precache task
+ // was run.
+ void RegisterSyntheticFieldTrial(const base::Time& last_precache_time);
+
// Callback when fetching unfinished work from storage is done.
void OnGetUnfinishedWorkDone(
std::unique_ptr<PrecacheUnfinishedWork> unfinished_work);
@@ -206,6 +213,10 @@ class PrecacheManager : public KeyedService,
// Work that hasn't yet finished.
std::unique_ptr<PrecacheUnfinishedWork> unfinished_work_;
+ // Callback to register the synthetic field trial.
+ const base::Callback<void(const base::Time&)>
+ register_synthetic_field_trial_callback_;
+
DISALLOW_COPY_AND_ASSIGN(PrecacheManager);
};

Powered by Google App Engine
This is Rietveld 408576698