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

Unified Diff: components/password_manager/core/browser/affiliation_backend.h

Issue 947563002: Add prefetch support to AffiliationBackend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment phrasing. Created 5 years, 10 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/password_manager/core/browser/affiliation_backend.h
diff --git a/components/password_manager/core/browser/affiliation_backend.h b/components/password_manager/core/browser/affiliation_backend.h
index eea5e3d7a55ecb5850863ce8f1c2b52bc5f50a31..99ac3e21f751686904b611b3aaeda3fb09313f39 100644
--- a/components/password_manager/core/browser/affiliation_backend.h
+++ b/components/password_manager/core/browser/affiliation_backend.h
@@ -70,18 +70,29 @@ class AffiliationBackend : public FacetManagerHost,
const base::Time& keep_fresh_until);
void TrimCache();
+ // Used only for testing.
+ size_t facet_manager_count() { return facet_managers_.size(); }
+
private:
+ // Retrieves the FacetManager corresponding to |facet_uri|, creating it and
+ // storing it into |facet_managers_| if it did not exist.
+ FacetManager* GetOrCreateFacetManager(const FacetURI& facet_uri);
+
// Collects facet URIs that require fetching and issues a network request
// against the Affiliation API to fetch corresponding affiliation information.
void SendNetworkRequest();
+ // Scheduled by RequestNotificationAtTime() to be called back at times when a
+ // FacetManager needs to be notified.
+ void OnSendNotification(const FacetURI& facet_uri);
+
// FacetManagerHost:
- base::Time GetCurrentTime() override;
- base::Time ReadLastUpdateTimeFromDatabase(const FacetURI& facet_uri) override;
bool ReadAffiliationsFromDatabase(
const FacetURI& facet_uri,
AffiliatedFacetsWithUpdateTime* affiliations) override;
void SignalNeedNetworkRequest() override;
+ void RequestNotificationAtTime(const FacetURI& facet_uri,
+ base::Time time) override;
// AffiliationFetcherDelegate:
void OnFetchSucceeded(

Powered by Google App Engine
This is Rietveld 408576698