| 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" |
| 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 13 #include "components/domain_reliability/beacon.h" | 14 #include "components/domain_reliability/beacon.h" |
| 14 #include "components/domain_reliability/clear_mode.h" | 15 #include "components/domain_reliability/clear_mode.h" |
| 15 #include "components/domain_reliability/config.h" | 16 #include "components/domain_reliability/config.h" |
| 16 #include "components/domain_reliability/context.h" | 17 #include "components/domain_reliability/context.h" |
| 17 #include "components/domain_reliability/dispatcher.h" | 18 #include "components/domain_reliability/dispatcher.h" |
| 18 #include "components/domain_reliability/domain_reliability_export.h" | 19 #include "components/domain_reliability/domain_reliability_export.h" |
| 19 #include "components/domain_reliability/scheduler.h" | 20 #include "components/domain_reliability/scheduler.h" |
| 20 #include "components/domain_reliability/uploader.h" | 21 #include "components/domain_reliability/uploader.h" |
| 21 #include "components/domain_reliability/util.h" | 22 #include "components/domain_reliability/util.h" |
| 22 #include "net/base/load_timing_info.h" | 23 #include "net/base/load_timing_info.h" |
| 23 #include "net/http/http_response_info.h" | 24 #include "net/http/http_response_info.h" |
| 24 #include "net/url_request/url_request_status.h" | 25 #include "net/url_request/url_request_status.h" |
| 25 | 26 |
| 26 namespace base { | 27 namespace base { |
| 27 class SingleThreadTaskRunner; | 28 class SingleThreadTaskRunner; |
| 28 class ThreadChecker; | 29 class ThreadChecker; |
| 30 class Value; |
| 29 } // namespace base | 31 } // namespace base |
| 30 | 32 |
| 31 namespace net { | 33 namespace net { |
| 32 class URLRequest; | 34 class URLRequest; |
| 33 class URLRequestContext; | 35 class URLRequestContext; |
| 34 class URLRequestContextGetter; | 36 class URLRequestContextGetter; |
| 35 } // namespace net | 37 } // namespace net |
| 36 | 38 |
| 37 namespace domain_reliability { | 39 namespace domain_reliability { |
| 38 | 40 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 64 // Should be called when |request| is complete. Will examine and possibly | 66 // Should be called when |request| is complete. Will examine and possibly |
| 65 // log the (final) request. (|started| should be true if the request was | 67 // log the (final) request. (|started| should be true if the request was |
| 66 // actually started before it was terminated.) | 68 // actually started before it was terminated.) |
| 67 void OnCompleted(net::URLRequest* request, bool started); | 69 void OnCompleted(net::URLRequest* request, bool started); |
| 68 | 70 |
| 69 // Called to remove browsing data. With CLEAR_BEACONS, leaves contexts in | 71 // Called to remove browsing data. With CLEAR_BEACONS, leaves contexts in |
| 70 // place but clears beacons (which betray browsing history); with | 72 // place but clears beacons (which betray browsing history); with |
| 71 // CLEAR_CONTEXTS, removes all contexts (which can behave as cookies). | 73 // CLEAR_CONTEXTS, removes all contexts (which can behave as cookies). |
| 72 void ClearBrowsingData(DomainReliabilityClearMode mode); | 74 void ClearBrowsingData(DomainReliabilityClearMode mode); |
| 73 | 75 |
| 76 // Gets a Value containing data that can be formatted into a web page for |
| 77 // debugging purposes. |
| 78 scoped_ptr<const base::Value> GetWebUIData() const; |
| 79 |
| 74 DomainReliabilityContext* AddContextForTesting( | 80 DomainReliabilityContext* AddContextForTesting( |
| 75 scoped_ptr<const DomainReliabilityConfig> config); | 81 scoped_ptr<const DomainReliabilityConfig> config); |
| 76 | 82 |
| 77 size_t contexts_size_for_testing() const { return contexts_.size(); } | 83 size_t contexts_size_for_testing() const { return contexts_.size(); } |
| 78 | 84 |
| 79 private: | 85 private: |
| 80 friend class DomainReliabilityMonitorTest; | 86 friend class DomainReliabilityMonitorTest; |
| 81 // Allow the Service to call |MakeWeakPtr|. | 87 // Allow the Service to call |MakeWeakPtr|. |
| 82 friend class DomainReliabilityServiceImpl; | 88 friend class DomainReliabilityServiceImpl; |
| 83 | 89 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 ContextMap contexts_; | 123 ContextMap contexts_; |
| 118 | 124 |
| 119 base::WeakPtrFactory<DomainReliabilityMonitor> weak_factory_; | 125 base::WeakPtrFactory<DomainReliabilityMonitor> weak_factory_; |
| 120 | 126 |
| 121 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityMonitor); | 127 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityMonitor); |
| 122 }; | 128 }; |
| 123 | 129 |
| 124 } // namespace domain_reliability | 130 } // namespace domain_reliability |
| 125 | 131 |
| 126 #endif // COMPONENTS_DOMAIN_RELIABILITY_MONITOR_H_ | 132 #endif // COMPONENTS_DOMAIN_RELIABILITY_MONITOR_H_ |
| OLD | NEW |