| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_BACKEND_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_BACKEND_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_BACKEND_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_BACKEND_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void GetAffiliations( | 72 void GetAffiliations( |
| 73 const FacetURI& facet_uri, | 73 const FacetURI& facet_uri, |
| 74 StrategyOnCacheMiss cache_miss_strategy, | 74 StrategyOnCacheMiss cache_miss_strategy, |
| 75 const AffiliationService::ResultCallback& callback, | 75 const AffiliationService::ResultCallback& callback, |
| 76 const scoped_refptr<base::TaskRunner>& callback_task_runner); | 76 const scoped_refptr<base::TaskRunner>& callback_task_runner); |
| 77 void Prefetch(const FacetURI& facet_uri, const base::Time& keep_fresh_until); | 77 void Prefetch(const FacetURI& facet_uri, const base::Time& keep_fresh_until); |
| 78 void CancelPrefetch(const FacetURI& facet_uri, | 78 void CancelPrefetch(const FacetURI& facet_uri, |
| 79 const base::Time& keep_fresh_until); | 79 const base::Time& keep_fresh_until); |
| 80 void TrimCache(); | 80 void TrimCache(); |
| 81 | 81 |
| 82 // Deletes the cache database file at |db_path|, and all auxiliary files. The |
| 83 // database must be closed before calling this. |
| 84 static void DeleteCache(const base::FilePath& db_path); |
| 85 |
| 82 private: | 86 private: |
| 83 friend class AffiliationBackendTest; | 87 friend class AffiliationBackendTest; |
| 84 | 88 |
| 85 // Retrieves the FacetManager corresponding to |facet_uri|, creating it and | 89 // Retrieves the FacetManager corresponding to |facet_uri|, creating it and |
| 86 // storing it into |facet_managers_| if it did not exist. | 90 // storing it into |facet_managers_| if it did not exist. |
| 87 FacetManager* GetOrCreateFacetManager(const FacetURI& facet_uri); | 91 FacetManager* GetOrCreateFacetManager(const FacetURI& facet_uri); |
| 88 | 92 |
| 89 // Scheduled by RequestNotificationAtTime() to be called back at times when a | 93 // Scheduled by RequestNotificationAtTime() to be called back at times when a |
| 90 // FacetManager needs to be notified. | 94 // FacetManager needs to be notified. |
| 91 void OnSendNotification(const FacetURI& facet_uri); | 95 void OnSendNotification(const FacetURI& facet_uri); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 base::ScopedPtrHashMap<FacetURI, scoped_ptr<FacetManager>> facet_managers_; | 143 base::ScopedPtrHashMap<FacetURI, scoped_ptr<FacetManager>> facet_managers_; |
| 140 | 144 |
| 141 base::WeakPtrFactory<AffiliationBackend> weak_ptr_factory_; | 145 base::WeakPtrFactory<AffiliationBackend> weak_ptr_factory_; |
| 142 | 146 |
| 143 DISALLOW_COPY_AND_ASSIGN(AffiliationBackend); | 147 DISALLOW_COPY_AND_ASSIGN(AffiliationBackend); |
| 144 }; | 148 }; |
| 145 | 149 |
| 146 } // namespace password_manager | 150 } // namespace password_manager |
| 147 | 151 |
| 148 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_BACKEND_H_ | 152 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_BACKEND_H_ |
| OLD | NEW |