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

Unified Diff: components/autofill/core/browser/autofill_download.h

Issue 49303005: Parameterize the PrefService that AutofillDownloadManager uses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test, introduce PrefService testing helper Created 7 years, 1 month 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/autofill/core/browser/autofill_download.h
diff --git a/components/autofill/core/browser/autofill_download.h b/components/autofill/core/browser/autofill_download.h
index bba1d7197629883d732c07f2c56620984c8faee2..f712036296c4432f07598cb034e6b21792ef49c1 100644
--- a/components/autofill/core/browser/autofill_download.h
+++ b/components/autofill/core/browser/autofill_download.h
@@ -18,6 +18,8 @@
#include "components/autofill/core/browser/autofill_type.h"
#include "net/url_request/url_fetcher_delegate.h"
+class PrefService;
+
namespace content {
class BrowserContext;
} // namespace content
@@ -62,8 +64,10 @@ class AutofillDownloadManager : public net::URLFetcherDelegate {
virtual ~Observer() {}
};
+ // |context| and |pref_service| must outlive this instance.
// |observer| - observer to notify on successful completion or error.
AutofillDownloadManager(content::BrowserContext* context,
+ PrefService* pref_service,
Observer* observer);
virtual ~AutofillDownloadManager();
@@ -132,12 +136,15 @@ class AutofillDownloadManager : public net::URLFetcherDelegate {
void SetPositiveUploadRate(double rate);
void SetNegativeUploadRate(double rate);
- // The pointer value is const, so this can only be set in the
- // constructor. Must not be null.
+ // The BrowserContext that this instance will use. Must not be null, and must
+ // outlive this instance.
content::BrowserContext* const browser_context_; // WEAK
+ // The PrefService that this instance will use. Must not be null, and must
+ // outlive this instance.
+ PrefService* const pref_service_; // WEAK
+
// The observer to notify when server predictions are successfully received.
- // The pointer value is const, so this can only be set in the constructor.
// Must not be null.
AutofillDownloadManager::Observer* const observer_; // WEAK

Powered by Google App Engine
This is Rietveld 408576698