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 18 matching lines...) Expand all Loading... | |
29 class MockableTime; | 29 class MockableTime; |
30 | 30 |
31 // The per-domain context for the Domain Reliability client; includes the | 31 // The per-domain context for the Domain Reliability client; includes the |
32 // domain's config and per-resource beacon queues. | 32 // domain's config and per-resource beacon queues. |
33 class DOMAIN_RELIABILITY_EXPORT DomainReliabilityContext { | 33 class DOMAIN_RELIABILITY_EXPORT DomainReliabilityContext { |
34 public: | 34 public: |
35 DomainReliabilityContext( | 35 DomainReliabilityContext( |
36 MockableTime* time, | 36 MockableTime* time, |
37 const DomainReliabilityScheduler::Params& scheduler_params, | 37 const DomainReliabilityScheduler::Params& scheduler_params, |
38 const std::string& upload_reporter_string, | 38 const std::string& upload_reporter_string, |
39 const base::TimeTicks* last_network_change_time, | |
davidben
2014/11/03 19:25:33
Could you add a comment somewhere documenting why
Deprecated (see juliatuttle)
2014/11/04 17:56:52
Done (well, to the member variable).
| |
39 DomainReliabilityDispatcher* dispatcher, | 40 DomainReliabilityDispatcher* dispatcher, |
40 DomainReliabilityUploader* uploader, | 41 DomainReliabilityUploader* uploader, |
41 scoped_ptr<const DomainReliabilityConfig> config); | 42 scoped_ptr<const DomainReliabilityConfig> config); |
42 ~DomainReliabilityContext(); | 43 ~DomainReliabilityContext(); |
43 | 44 |
44 // Notifies the context of a beacon on its domain(s); may or may not save the | 45 // Notifies the context of a beacon on its domain(s); may or may not save the |
45 // actual beacon to be uploaded, depending on the sample rates in the config, | 46 // actual beacon to be uploaded, depending on the sample rates in the config, |
46 // but will increment one of the request counters in any case. | 47 // but will increment one of the request counters in any case. |
47 void OnBeacon(const GURL& url, const DomainReliabilityBeacon& beacon); | 48 void OnBeacon(const GURL& url, const DomainReliabilityBeacon& beacon); |
48 | 49 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 DomainReliabilityDispatcher* dispatcher_; | 104 DomainReliabilityDispatcher* dispatcher_; |
104 DomainReliabilityUploader* uploader_; | 105 DomainReliabilityUploader* uploader_; |
105 | 106 |
106 BeaconDeque beacons_; | 107 BeaconDeque beacons_; |
107 size_t uploading_beacons_size_; | 108 size_t uploading_beacons_size_; |
108 // Each ResourceState in |states_| corresponds to the Resource of the same | 109 // Each ResourceState in |states_| corresponds to the Resource of the same |
109 // index in the config. | 110 // index in the config. |
110 ResourceStateVector states_; | 111 ResourceStateVector states_; |
111 base::TimeTicks upload_time_; | 112 base::TimeTicks upload_time_; |
112 base::TimeTicks last_upload_time_; | 113 base::TimeTicks last_upload_time_; |
114 const base::TimeTicks* last_network_change_time_; | |
113 | 115 |
114 base::WeakPtrFactory<DomainReliabilityContext> weak_factory_; | 116 base::WeakPtrFactory<DomainReliabilityContext> weak_factory_; |
115 | 117 |
116 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityContext); | 118 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityContext); |
117 }; | 119 }; |
118 | 120 |
119 } // namespace domain_reliability | 121 } // namespace domain_reliability |
120 | 122 |
121 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_ | 123 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_ |
OLD | NEW |