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

Unified Diff: net/reporting/reporting_delivery_agent.h

Issue 2751103002: Reporting: Wrap existing classes in context. (Closed)
Patch Set: rebase Created 3 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/reporting/reporting_delegate.cc ('k') | net/reporting/reporting_delivery_agent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_delivery_agent.h
diff --git a/net/reporting/reporting_delivery_agent.h b/net/reporting/reporting_delivery_agent.h
index f6cda8139e24ccddab1a9af6e803b097ae63ab4b..eaae8a3ae6207a55fd71e715a557819d7109f5c7 100644
--- a/net/reporting/reporting_delivery_agent.h
+++ b/net/reporting/reporting_delivery_agent.h
@@ -14,7 +14,7 @@
#include "base/memory/weak_ptr.h"
#include "net/base/backoff_entry.h"
#include "net/base/net_export.h"
-#include "net/reporting/reporting_endpoint_manager.h"
+#include "net/reporting/reporting_context.h"
#include "net/reporting/reporting_uploader.h"
#include "url/gurl.h"
#include "url/origin.h"
@@ -26,6 +26,7 @@ class TickClock;
namespace net {
class ReportingCache;
+class ReportingEndpointManager;
// Takes reports from the ReportingCache, assembles reports into deliveries to
// endpoints, and sends those deliveries using ReportingUploader.
@@ -58,12 +59,8 @@ class ReportingCache;
// delivery attempt.
class NET_EXPORT ReportingDeliveryAgent {
public:
- // |clock|, |cache|, |uploader|, and |endpoint_backoff_policy| must all
- // outlive the ReportingDeliveryAgent.
- ReportingDeliveryAgent(base::TickClock* clock,
- ReportingCache* cache,
- ReportingUploader* uploader,
- const BackoffEntry::Policy* endpoint_backoff_policy);
+ // |context| must outlive the ReportingDeliveryAgent.
+ ReportingDeliveryAgent(ReportingContext* context);
~ReportingDeliveryAgent();
// Tries to deliver all of the reports in the cache. Reports that are already
@@ -79,11 +76,14 @@ class NET_EXPORT ReportingDeliveryAgent {
void OnUploadComplete(const std::unique_ptr<Delivery>& delivery,
ReportingUploader::Outcome outcome);
- base::TickClock* clock_;
- ReportingCache* cache_;
- ReportingUploader* uploader_;
+ base::TickClock* tick_clock() { return context_->tick_clock(); }
+ ReportingCache* cache() { return context_->cache(); }
+ ReportingUploader* uploader() { return context_->uploader(); }
+ ReportingEndpointManager* endpoint_manager() {
+ return context_->endpoint_manager();
+ }
- ReportingEndpointManager endpoint_manager_;
+ ReportingContext* context_;
// Tracks OriginGroup tuples for which there is a pending delivery running.
// (Would be an unordered_set, but there's no hash on pair.)
« no previous file with comments | « net/reporting/reporting_delegate.cc ('k') | net/reporting/reporting_delivery_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698