Chromium Code Reviews| Index: components/domain_reliability/context.h |
| diff --git a/components/domain_reliability/context.h b/components/domain_reliability/context.h |
| index 528c8ab168721174099e89acf9c9b4acaac63621..5b91e1e023d88ea5e8926834f9070b829d66b096 100644 |
| --- a/components/domain_reliability/context.h |
| +++ b/components/domain_reliability/context.h |
| @@ -53,7 +53,7 @@ class DOMAIN_RELIABILITY_EXPORT DomainReliabilityContext { |
| // Notifies the context of a beacon on its domain(s); may or may not save the |
| // actual beacon to be uploaded, depending on the sample rates in the config, |
| // but will increment one of the request counters in any case. |
| - void OnBeacon(const GURL& url, const DomainReliabilityBeacon& beacon); |
| + void OnBeacon(scoped_ptr<DomainReliabilityBeacon> beacon); |
| // Called to clear browsing data, since beacons are like browsing history. |
| void ClearBeacons(); |
| @@ -62,13 +62,11 @@ class DOMAIN_RELIABILITY_EXPORT DomainReliabilityContext { |
| // debugging purposes. |
| scoped_ptr<base::Value> GetWebUIData() const; |
| + // Gets the beacons queued for upload in this context. |beacons_out| will be |
|
Randy Smith (Not in Mondays)
2015/10/29 22:36:11
nit: |*beacons_out|.
Deprecated (see juliatuttle)
2015/11/02 23:19:30
Done.
|
| + // cleared and filled with pointers to the beacons; the pointers remain valid |
| + // as long as no other requests are reported to the DomainReliabilityMonitor. |
|
Randy Smith (Not in Mondays)
2015/10/29 22:36:11
nit, suggestion: These lifetime related requiremen
Deprecated (see juliatuttle)
2015/11/02 23:19:30
Would you be okay if I punted this to another CL t
Randy Smith (Not in Mondays)
2015/11/03 21:48:12
Sure.
|
| void GetQueuedBeaconsForTesting( |
| - std::vector<DomainReliabilityBeacon>* beacons_out) const; |
| - |
| - void GetRequestCountsForTesting( |
| - size_t resource_index, |
| - uint32* successful_requests_out, |
| - uint32* failed_requests_out) const; |
| + std::vector<const DomainReliabilityBeacon*>* beacons_out) const; |
| const DomainReliabilityConfig& config() const { return *config_.get(); } |
| @@ -77,18 +75,14 @@ class DOMAIN_RELIABILITY_EXPORT DomainReliabilityContext { |
| static const size_t kMaxQueuedBeacons; |
| private: |
| - class ResourceState; |
| - |
| - typedef std::deque<DomainReliabilityBeacon> BeaconDeque; |
| - typedef ScopedVector<ResourceState> ResourceStateVector; |
| - typedef ResourceStateVector::const_iterator ResourceStateIterator; |
| + typedef std::deque<DomainReliabilityBeacon*> BeaconDeque; |
| - void InitializeResourceStates(); |
| void ScheduleUpload(base::TimeDelta min_delay, base::TimeDelta max_delay); |
| void StartUpload(); |
| void OnUploadComplete(const DomainReliabilityUploader::UploadResult& result); |
| - scoped_ptr<const base::Value> CreateReport(base::TimeTicks upload_time) const; |
| + scoped_ptr<const base::Value> CreateReport(base::TimeTicks upload_time, |
| + const GURL& collector_url) const; |
| // Remembers the current state of the context when an upload starts. Can be |
| // called multiple times in a row (without |CommitUpload|) if uploads fail |
| @@ -114,9 +108,6 @@ class DOMAIN_RELIABILITY_EXPORT DomainReliabilityContext { |
| BeaconDeque beacons_; |
| size_t uploading_beacons_size_; |
| - // Each ResourceState in |states_| corresponds to the Resource of the same |
| - // index in the config. |
| - ResourceStateVector states_; |
| base::TimeTicks upload_time_; |
| base::TimeTicks last_upload_time_; |
| // The last network change time is not tracked per-context, so this is a |