| 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_MONITOR_H_ | 5 #ifndef COMPONENTS_DOMAIN_RELIABILITY_MONITOR_H_ |
| 6 #define COMPONENTS_DOMAIN_RELIABILITY_MONITOR_H_ | 6 #define COMPONENTS_DOMAIN_RELIABILITY_MONITOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 ~DomainReliabilityMonitor(); | 44 ~DomainReliabilityMonitor(); |
| 45 | 45 |
| 46 // Adds the "baked-in" configuration(s) for Google sites. | 46 // Adds the "baked-in" configuration(s) for Google sites. |
| 47 void AddBakedInConfigs(); | 47 void AddBakedInConfigs(); |
| 48 | 48 |
| 49 // Should be called from the profile's NetworkDelegate on the corresponding | 49 // Should be called from the profile's NetworkDelegate on the corresponding |
| 50 // events: | 50 // events: |
| 51 void OnBeforeRedirect(net::URLRequest* request); | 51 void OnBeforeRedirect(net::URLRequest* request); |
| 52 void OnCompleted(net::URLRequest* request, bool started); | 52 void OnCompleted(net::URLRequest* request, bool started); |
| 53 | 53 |
| 54 // Called to remove browsing data: |
| 55 |
| 56 // Removes all of the contexts being monitored. Since configs can contain |
| 57 // site-provided data (config version, resource names, etc.) that will be |
| 58 // repeated back in uploads, this should be treated like site data. |
| 59 void ClearContexts(); |
| 60 |
| 61 // Removes all of the beacons stored in contexts, without removing the |
| 62 // contexts. Since beacons can contain data derivative of browsing history, |
| 63 // this should be treated like history. |
| 64 void ClearBeacons(); |
| 65 |
| 54 DomainReliabilityContext* AddContextForTesting( | 66 DomainReliabilityContext* AddContextForTesting( |
| 55 scoped_ptr<const DomainReliabilityConfig> config); | 67 scoped_ptr<const DomainReliabilityConfig> config); |
| 56 | 68 |
| 57 size_t contexts_size_for_testing() const { return contexts_.size(); } | 69 size_t contexts_size_for_testing() const { return contexts_.size(); } |
| 58 | 70 |
| 59 private: | 71 private: |
| 60 friend class DomainReliabilityMonitorTest; | 72 friend class DomainReliabilityMonitorTest; |
| 61 | 73 |
| 62 typedef std::map<std::string, DomainReliabilityContext*> ContextMap; | 74 typedef std::map<std::string, DomainReliabilityContext*> ContextMap; |
| 63 | 75 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 89 DomainReliabilityDispatcher dispatcher_; | 101 DomainReliabilityDispatcher dispatcher_; |
| 90 scoped_ptr<DomainReliabilityUploader> uploader_; | 102 scoped_ptr<DomainReliabilityUploader> uploader_; |
| 91 ContextMap contexts_; | 103 ContextMap contexts_; |
| 92 | 104 |
| 93 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityMonitor); | 105 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityMonitor); |
| 94 }; | 106 }; |
| 95 | 107 |
| 96 } // namespace domain_reliability | 108 } // namespace domain_reliability |
| 97 | 109 |
| 98 #endif // COMPONENTS_DOMAIN_RELIABILITY_MONITOR_H_ | 110 #endif // COMPONENTS_DOMAIN_RELIABILITY_MONITOR_H_ |
| OLD | NEW |