| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DOMAIN_RELIABILITY_SERVICE_H_ | 5 #ifndef COMPONENTS_DOMAIN_RELIABILITY_SERVICE_H_ |
| 6 #define COMPONENTS_DOMAIN_RELIABILITY_SERVICE_H_ | 6 #define COMPONENTS_DOMAIN_RELIABILITY_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "components/domain_reliability/clear_mode.h" | 15 #include "components/domain_reliability/clear_mode.h" |
| 16 #include "components/domain_reliability/domain_reliability_export.h" | 16 #include "components/domain_reliability/domain_reliability_export.h" |
| 17 #include "components/keyed_service/core/keyed_service.h" | 17 #include "components/keyed_service/core/keyed_service.h" |
| 18 | 18 |
| 19 class GURL; |
| 19 class PrefService; | 20 class PrefService; |
| 20 | 21 |
| 21 namespace base { | 22 namespace base { |
| 22 class Value; | 23 class Value; |
| 23 } // namespace base | 24 } // namespace base |
| 24 | 25 |
| 25 namespace net { | 26 namespace net { |
| 26 class URLRequestContextGetter; | 27 class URLRequestContextGetter; |
| 27 } // namespace net | 28 } // namespace net |
| 28 | 29 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 47 // Initializes the Service: given the task runner on which Monitor methods | 48 // Initializes the Service: given the task runner on which Monitor methods |
| 48 // should be called, creates the Monitor and returns it. Can be called at | 49 // should be called, creates the Monitor and returns it. Can be called at |
| 49 // most once, and must be called before any of the below methods can be | 50 // most once, and must be called before any of the below methods can be |
| 50 // called. The caller is responsible for destroying the Monitor on the given | 51 // called. The caller is responsible for destroying the Monitor on the given |
| 51 // task runner when it is no longer needed. | 52 // task runner when it is no longer needed. |
| 52 virtual std::unique_ptr<DomainReliabilityMonitor> CreateMonitor( | 53 virtual std::unique_ptr<DomainReliabilityMonitor> CreateMonitor( |
| 53 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) = 0; | 54 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) = 0; |
| 54 | 55 |
| 55 // Clears browsing data on the associated Monitor. |Init()| must have been | 56 // Clears browsing data on the associated Monitor. |Init()| must have been |
| 56 // called first. | 57 // called first. |
| 57 virtual void ClearBrowsingData(DomainReliabilityClearMode clear_mode, | 58 virtual void ClearBrowsingData( |
| 58 const base::Closure& callback) = 0; | 59 DomainReliabilityClearMode clear_mode, |
| 60 const base::Callback<bool(const GURL&)>& origin, |
| 61 const base::Closure& callback) = 0; |
| 59 | 62 |
| 60 virtual void GetWebUIData( | 63 virtual void GetWebUIData( |
| 61 const base::Callback<void(std::unique_ptr<base::Value>)>& callback) | 64 const base::Callback<void(std::unique_ptr<base::Value>)>& callback) |
| 62 const = 0; | 65 const = 0; |
| 63 | 66 |
| 64 protected: | 67 protected: |
| 65 DomainReliabilityService(); | 68 DomainReliabilityService(); |
| 66 | 69 |
| 67 private: | 70 private: |
| 68 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityService); | 71 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityService); |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 } // namespace domain_reliability | 74 } // namespace domain_reliability |
| 72 | 75 |
| 73 #endif // COMPONENTS_DOMAIN_RELIABILITY_SERVICE_H_ | 76 #endif // COMPONENTS_DOMAIN_RELIABILITY_SERVICE_H_ |
| OLD | NEW |