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" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // and proxies (selected) method calls to it. Destruction of the Monitor (on | 35 // and proxies (selected) method calls to it. Destruction of the Monitor (on |
36 // that thread) is the responsibility of the caller. | 36 // that thread) is the responsibility of the caller. |
37 class DOMAIN_RELIABILITY_EXPORT DomainReliabilityService | 37 class DOMAIN_RELIABILITY_EXPORT DomainReliabilityService |
38 : public KeyedService { | 38 : public KeyedService { |
39 public: | 39 public: |
40 // Creates a DomainReliabilityService that will contain a Monitor with the | 40 // Creates a DomainReliabilityService that will contain a Monitor with the |
41 // given upload reporter string. | 41 // given upload reporter string. |
42 static DomainReliabilityService* Create( | 42 static DomainReliabilityService* Create( |
43 const std::string& upload_reporter_string); | 43 const std::string& upload_reporter_string); |
44 | 44 |
45 virtual ~DomainReliabilityService(); | 45 ~DomainReliabilityService() override; |
46 | 46 |
47 // Initializes the Service: given the task runner on which Monitor methods | 47 // 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 | 48 // 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 | 49 // 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 | 50 // called. The caller is responsible for destroying the Monitor on the given |
51 // task runner when it is no longer needed. | 51 // task runner when it is no longer needed. |
52 virtual scoped_ptr<DomainReliabilityMonitor> CreateMonitor( | 52 virtual scoped_ptr<DomainReliabilityMonitor> CreateMonitor( |
53 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) = 0; | 53 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) = 0; |
54 | 54 |
55 // Clears browsing data on the associated Monitor. |Init()| must have been | 55 // Clears browsing data on the associated Monitor. |Init()| must have been |
56 // called first. | 56 // called first. |
57 virtual void ClearBrowsingData(DomainReliabilityClearMode clear_mode, | 57 virtual void ClearBrowsingData(DomainReliabilityClearMode clear_mode, |
58 const base::Closure& callback) = 0; | 58 const base::Closure& callback) = 0; |
59 | 59 |
60 virtual void GetWebUIData( | 60 virtual void GetWebUIData( |
61 const base::Callback<void(scoped_ptr<base::Value>)>& callback) | 61 const base::Callback<void(scoped_ptr<base::Value>)>& callback) |
62 const = 0; | 62 const = 0; |
63 | 63 |
64 protected: | 64 protected: |
65 DomainReliabilityService(); | 65 DomainReliabilityService(); |
66 | 66 |
67 private: | 67 private: |
68 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityService); | 68 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityService); |
69 }; | 69 }; |
70 | 70 |
71 } // namespace domain_reliability | 71 } // namespace domain_reliability |
72 | 72 |
73 #endif // COMPONENTS_DOMAIN_RELIABILITY_SERVICE_H_ | 73 #endif // COMPONENTS_DOMAIN_RELIABILITY_SERVICE_H_ |
OLD | NEW |