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

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: Change IsSyncEnabledAndLoggedIn to CanSyncStart. 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
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..d2e21a85995830ff73bb43c3f6e483cc915de7f4 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);
+ explicit PrecacheManager(content::BrowserContext* browser_context,
Lei Zhang 2015/06/17 21:41:52 nit: no longer explicit
twifkak 2015/06/17 22:12:02 Done.
+ sync_driver::SyncService* sync_service);
~PrecacheManager() override;
// Returns true if precaching is enabled as part of a field trial or by the
@@ -95,6 +100,10 @@ class PrecacheManager : public KeyedService,
// The browser context that owns this PrecacheManager.
content::BrowserContext* browser_context_;
+ // The sync service corresponding to the browser context. Used to determine
+ // whether precache can run. May be null.
+ sync_driver::SyncService* sync_service_;
Lei Zhang 2015/06/17 21:41:52 This can be sync_driver::SyncService* const, since
twifkak 2015/06/17 22:12:02 Done (et al.).
+
// The PrecacheFetcher used to precache resources. Should only be used on the
// UI thread.
scoped_ptr<PrecacheFetcher> precache_fetcher_;

Powered by Google App Engine
This is Rietveld 408576698