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_CONTEXT_H_ | 5 #ifndef COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_ |
6 #define COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_ | 6 #define COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // Called to clear browsing data, since beacons are like browsing history. | 46 // Called to clear browsing data, since beacons are like browsing history. |
47 void ClearBeacons(); | 47 void ClearBeacons(); |
48 | 48 |
49 void GetQueuedDataForTesting( | 49 void GetQueuedDataForTesting( |
50 size_t resource_index, | 50 size_t resource_index, |
51 std::vector<DomainReliabilityBeacon>* beacons_out, | 51 std::vector<DomainReliabilityBeacon>* beacons_out, |
52 uint32* successful_requests_out, | 52 uint32* successful_requests_out, |
53 uint32* failed_requests_out) const; | 53 uint32* failed_requests_out) const; |
54 | 54 |
55 const DomainReliabilityConfig& config() { return *config_.get(); } | 55 const DomainReliabilityConfig& config() const { return *config_.get(); } |
56 | 56 |
57 // Maximum number of beacons queued per context; if more than this many are | 57 // Maximum number of beacons queued per context; if more than this many are |
58 // queued; the oldest beacons will be removed. | 58 // queued; the oldest beacons will be removed. |
59 static const size_t kMaxQueuedBeacons; | 59 static const size_t kMaxQueuedBeacons; |
60 | 60 |
61 private: | 61 private: |
62 class ResourceState; | 62 class ResourceState; |
63 | 63 |
64 typedef ScopedVector<ResourceState> ResourceStateVector; | 64 typedef ScopedVector<ResourceState> ResourceStateVector; |
65 typedef ResourceStateVector::const_iterator ResourceStateIterator; | 65 typedef ResourceStateVector::const_iterator ResourceStateIterator; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 base::TimeTicks last_upload_time_; | 102 base::TimeTicks last_upload_time_; |
103 | 103 |
104 base::WeakPtrFactory<DomainReliabilityContext> weak_factory_; | 104 base::WeakPtrFactory<DomainReliabilityContext> weak_factory_; |
105 | 105 |
106 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityContext); | 106 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityContext); |
107 }; | 107 }; |
108 | 108 |
109 } // namespace domain_reliability | 109 } // namespace domain_reliability |
110 | 110 |
111 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_ | 111 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_ |
OLD | NEW |