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

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

Issue 2596093002: 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 ec093b0057a520aa177ac8fd282f8d7cae5fc70d..eee04410b416df18cb5c72f65f28b4fc67b255ed 100644
--- a/components/precache/content/precache_manager.h
+++ b/components/precache/content/precache_manager.h
@@ -81,7 +81,9 @@ class PrecacheManager : public KeyedService,
const data_reduction_proxy::DataReductionProxySettings*
data_reduction_proxy_settings,
const base::FilePath& db_path,
- std::unique_ptr<PrecacheDatabase> precache_database);
+ std::unique_ptr<PrecacheDatabase> precache_database,
+ const base::Callback<void(const base::Time&)>&
jamartin 2016/12/21 23:54:33 Idem.
twifkak 2017/01/05 23:53:14 Done.
+ register_synthetic_field_trial_callback);
~PrecacheManager() override;
// Returns true if the client is in the experiment group -- that is,
@@ -153,6 +155,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);
jamartin 2016/12/21 23:54:33 Idem.
twifkak 2017/01/05 23:53:14 Done.
+
// Callback when fetching unfinished work from storage is done.
void OnGetUnfinishedWorkDone(
std::unique_ptr<PrecacheUnfinishedWork> unfinished_work);
@@ -239,6 +246,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&)>
jamartin 2016/12/21 23:54:33 Idem.
twifkak 2017/01/05 23:53:14 Done.
+ register_synthetic_field_trial_callback_;
+
DISALLOW_COPY_AND_ASSIGN(PrecacheManager);
};

Powered by Google App Engine
This is Rietveld 408576698