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

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

Issue 1176253002: Fix IsPrecachingAllowed() to check Sync instead of Data Saver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks per bengr. Created 5 years, 6 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
« no previous file with comments | « components/precache/content/DEPS ('k') | components/precache/content/precache_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/precache/content/precache_manager.h
diff --git a/components/precache/content/precache_manager.h b/components/precache/content/precache_manager.h
index b69ad138330c882ae49a34fc37f6ed32a6ae2011..4ea021b1ab913a68496b3a18de6c81253119e26d 100644
--- a/components/precache/content/precache_manager.h
+++ b/components/precache/content/precache_manager.h
@@ -32,6 +32,10 @@ namespace history {
class HistoryService;
}
+namespace sync_driver {
+class SyncService;
+}
+
namespace precache {
class PrecacheDatabase;
@@ -52,7 +56,8 @@ class PrecacheManager : public KeyedService,
public:
typedef base::Closure PrecacheCompletionCallback;
- explicit PrecacheManager(content::BrowserContext* browser_context);
+ PrecacheManager(content::BrowserContext* browser_context,
+ const sync_driver::SyncService* const sync_service);
~PrecacheManager() override;
// Returns true if precaching is enabled as part of a field trial or by the
@@ -93,7 +98,11 @@ class PrecacheManager : public KeyedService,
void OnHostsReceived(const history::TopHostsList& host_counts);
// The browser context that owns this PrecacheManager.
- content::BrowserContext* browser_context_;
+ content::BrowserContext* const browser_context_;
+
+ // The sync service corresponding to the browser context. Used to determine
+ // whether precache can run. May be null.
+ const sync_driver::SyncService* const sync_service_;
// The PrecacheFetcher used to precache resources. Should only be used on the
// UI thread.
@@ -105,7 +114,7 @@ class PrecacheManager : public KeyedService,
// The PrecacheDatabase for tracking precache metrics. Should only be used on
// the DB thread.
- scoped_refptr<PrecacheDatabase> precache_database_;
+ const scoped_refptr<PrecacheDatabase> precache_database_;
// Flag indicating whether or not precaching is currently in progress.
bool is_precaching_;
« no previous file with comments | « components/precache/content/DEPS ('k') | components/precache/content/precache_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698