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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/sequenced_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 PrefService; |
| 20 |
19 namespace base { | 21 namespace base { |
20 class Value; | 22 class Value; |
21 } // namespace base | 23 } // namespace base |
22 | 24 |
23 namespace net { | 25 namespace net { |
24 class URLRequestContextGetter; | 26 class URLRequestContextGetter; |
25 } // namespace net | 27 } // namespace net |
26 | 28 |
27 namespace domain_reliability { | 29 namespace domain_reliability { |
28 | 30 |
(...skipping 12 matching lines...) Expand all Loading... |
41 const std::string& upload_reporter_string); | 43 const std::string& upload_reporter_string); |
42 | 44 |
43 virtual ~DomainReliabilityService(); | 45 virtual ~DomainReliabilityService(); |
44 | 46 |
45 // Initializes the Service: given the task runner on which Monitor methods | 47 // Initializes the Service: given the task runner on which Monitor methods |
46 // should be called, creates the Monitor and returns it. Can be called at | 48 // should be called, creates the Monitor and returns it. Can be called at |
47 // most once, and must be called before any of the below methods can be | 49 // most once, and must be called before any of the below methods can be |
48 // called. The caller is responsible for destroying the Monitor on the given | 50 // called. The caller is responsible for destroying the Monitor on the given |
49 // task runner when it is no longer needed. | 51 // task runner when it is no longer needed. |
50 virtual scoped_ptr<DomainReliabilityMonitor> CreateMonitor( | 52 virtual scoped_ptr<DomainReliabilityMonitor> CreateMonitor( |
51 scoped_refptr<base::SequencedTaskRunner> network_task_runner) = 0; | 53 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, |
| 54 PrefService* pref_service, |
| 55 const char* reporting_pref_name) = 0; |
52 | 56 |
53 // Clears browsing data on the associated Monitor. |Init()| must have been | 57 // Clears browsing data on the associated Monitor. |Init()| must have been |
54 // called first. | 58 // called first. |
55 virtual void ClearBrowsingData(DomainReliabilityClearMode clear_mode, | 59 virtual void ClearBrowsingData(DomainReliabilityClearMode clear_mode, |
56 const base::Closure& callback) = 0; | 60 const base::Closure& callback) = 0; |
57 | 61 |
58 virtual void GetWebUIData( | 62 virtual void GetWebUIData( |
59 const base::Callback<void(scoped_ptr<base::Value>)>& callback) | 63 const base::Callback<void(scoped_ptr<base::Value>)>& callback) |
60 const = 0; | 64 const = 0; |
61 | 65 |
62 protected: | 66 protected: |
63 DomainReliabilityService(); | 67 DomainReliabilityService(); |
64 | 68 |
65 private: | 69 private: |
66 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityService); | 70 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityService); |
67 }; | 71 }; |
68 | 72 |
69 } // namespace domain_reliability | 73 } // namespace domain_reliability |
70 | 74 |
71 #endif // COMPONENTS_DOMAIN_RELIABILITY_SERVICE_H_ | 75 #endif // COMPONENTS_DOMAIN_RELIABILITY_SERVICE_H_ |
OLD | NEW |