Index: net/reporting/reporting_context.h |
diff --git a/net/reporting/reporting_context.h b/net/reporting/reporting_context.h |
index 609813a5ad5d2944b9cc03dacc72d5856296848b..02425615039dd282419b9ebebc718df6c4592111 100644 |
--- a/net/reporting/reporting_context.h |
+++ b/net/reporting/reporting_context.h |
@@ -7,6 +7,7 @@ |
#include <memory> |
+#include "base/observer_list.h" |
#include "base/time/time.h" |
#include "net/base/backoff_entry.h" |
#include "net/base/net_export.h" |
@@ -23,6 +24,7 @@ class ReportingCache; |
class ReportingDelegate; |
class ReportingDeliveryAgent; |
class ReportingEndpointManager; |
+class ReportingObserver; |
class ReportingUploader; |
class URLRequestContext; |
@@ -50,6 +52,11 @@ class NET_EXPORT ReportingContext { |
} |
ReportingDeliveryAgent* delivery_agent() { return delivery_agent_.get(); } |
+ void AddObserver(ReportingObserver* observer); |
+ void RemoveObserver(ReportingObserver* observer); |
+ |
+ void NotifyCacheUpdated(); |
+ |
protected: |
ReportingContext(const ReportingPolicy& policy, |
std::unique_ptr<ReportingDelegate> delegate, |
@@ -65,6 +72,8 @@ class NET_EXPORT ReportingContext { |
std::unique_ptr<base::TickClock> tick_clock_; |
std::unique_ptr<ReportingUploader> uploader_; |
+ base::ObserverList<ReportingObserver, /* check_empty= */ true> observers_; |
+ |
std::unique_ptr<ReportingCache> cache_; |
// |endpoint_manager_| must come after |tick_clock_| and |cache_|. |