Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: components/domain_reliability/context.h

Issue 691053003: Domain Reliability: Mark beacons from previous networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Context unittest Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/domain_reliability/beacon.cc ('k') | components/domain_reliability/context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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,
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
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 // The last network change time is not tracked per-context, so this is a
115 // pointer to that value in a wider (e.g. per-Monitor or unittest) scope.
116 const base::TimeTicks* last_network_change_time_;
113 117
114 base::WeakPtrFactory<DomainReliabilityContext> weak_factory_; 118 base::WeakPtrFactory<DomainReliabilityContext> weak_factory_;
115 119
116 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityContext); 120 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityContext);
117 }; 121 };
118 122
119 } // namespace domain_reliability 123 } // namespace domain_reliability
120 124
121 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_ 125 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_
OLDNEW
« no previous file with comments | « components/domain_reliability/beacon.cc ('k') | components/domain_reliability/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698