| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Returns the reporting service associated with |context|. | 23 // Returns the reporting service associated with |context|. |
| 24 static CertificateReportingService* GetForBrowserContext( | 24 static CertificateReportingService* GetForBrowserContext( |
| 25 content::BrowserContext* context); | 25 content::BrowserContext* context); |
| 26 | 26 |
| 27 // Setters for testing. | 27 // Setters for testing. |
| 28 void SetReportEncryptionParamsForTesting(uint8_t* server_public_key, | 28 void SetReportEncryptionParamsForTesting(uint8_t* server_public_key, |
| 29 uint32_t server_public_key_version); | 29 uint32_t server_public_key_version); |
| 30 void SetClockForTesting(std::unique_ptr<base::Clock> clock); | 30 void SetClockForTesting(std::unique_ptr<base::Clock> clock); |
| 31 void SetQueuedReportTTLForTesting(base::TimeDelta queued_report_ttl); | 31 void SetQueuedReportTTLForTesting(base::TimeDelta queued_report_ttl); |
| 32 void SetMaxQueuedReportCountForTesting(size_t max_report_count); | 32 void SetMaxQueuedReportCountForTesting(size_t max_report_count); |
| 33 void SetServiceResetCallbackForTesting( |
| 34 const base::Callback<void()>& service_reset_callback); |
| 33 | 35 |
| 34 private: | 36 private: |
| 35 friend struct base::DefaultSingletonTraits< | 37 friend struct base::DefaultSingletonTraits< |
| 36 CertificateReportingServiceFactory>; | 38 CertificateReportingServiceFactory>; |
| 37 | 39 |
| 38 CertificateReportingServiceFactory(); | 40 CertificateReportingServiceFactory(); |
| 39 ~CertificateReportingServiceFactory() override; | 41 ~CertificateReportingServiceFactory() override; |
| 40 | 42 |
| 41 // BrowserContextKeyedServiceFactory overrides: | 43 // BrowserContextKeyedServiceFactory overrides: |
| 42 KeyedService* BuildServiceInstanceFor( | 44 KeyedService* BuildServiceInstanceFor( |
| 43 content::BrowserContext* context) const override; | 45 content::BrowserContext* context) const override; |
| 44 content::BrowserContext* GetBrowserContextToUse( | 46 content::BrowserContext* GetBrowserContextToUse( |
| 45 content::BrowserContext* context) const override; | 47 content::BrowserContext* context) const override; |
| 46 | 48 |
| 47 // Encryption parameters for certificate reports. | 49 // Encryption parameters for certificate reports. |
| 48 uint8_t* server_public_key_; | 50 uint8_t* server_public_key_; |
| 49 uint32_t server_public_key_version_; | 51 uint32_t server_public_key_version_; |
| 50 | 52 |
| 51 std::unique_ptr<base::Clock> clock_; | 53 std::unique_ptr<base::Clock> clock_; |
| 52 base::TimeDelta queued_report_ttl_; | 54 base::TimeDelta queued_report_ttl_; |
| 53 size_t max_queued_report_count_; | 55 size_t max_queued_report_count_; |
| 56 base::Callback<void()> service_reset_callback_; |
| 54 | 57 |
| 55 DISALLOW_COPY_AND_ASSIGN(CertificateReportingServiceFactory); | 58 DISALLOW_COPY_AND_ASSIGN(CertificateReportingServiceFactory); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 #endif // CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_FACTORY_H_ | 61 #endif // CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_FACTORY_H_ |
| OLD | NEW |