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..bf243766ee635817bf966201bf5ae4037ce78006 100644 |
| --- a/components/domain_reliability/context.h |
| +++ b/components/domain_reliability/context.h |
| @@ -30,7 +30,7 @@ class DomainReliabilityUploader; |
| class MockableTime; |
| // The per-domain context for the Domain Reliability client; includes the |
| -// domain's config and per-resource beacon queues. |
| +// domain's config and beacon queue. |
| class DOMAIN_RELIABILITY_EXPORT DomainReliabilityContext { |
| public: |
| class DOMAIN_RELIABILITY_EXPORT Factory { |
| @@ -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 |
| + // cleared and filled with pointers to the beacons; the pointers remain valid |
| + // as long as no other requests are reported to the DomainReliabilityMonitor. |
| 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; |
|
Randy Smith (Not in Mondays)
2015/11/03 21:48:12
If you've gotta store owned pointers in a raw poin
Deprecated (see juliatuttle)
2015/11/06 17:22:29
Done.
Randy Smith (Not in Mondays)
2015/11/09 21:23:24
nit: Comment here, in addition to or instead of th
Deprecated (see juliatuttle)
2015/11/10 17:39:49
Done.
|
| - 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 |