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

Unified Diff: net/reporting/reporting_context.h

Issue 2751883003: Reporting: Implement serializer. (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/BUILD.gn ('k') | net/reporting/reporting_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_context.h
diff --git a/net/reporting/reporting_context.h b/net/reporting/reporting_context.h
index c4360ea51e06801a30563788bd69ce958010229b..75aa11918ae6aeff76c20b59a146ca6ee1a2e10d 100644
--- a/net/reporting/reporting_context.h
+++ b/net/reporting/reporting_context.h
@@ -26,6 +26,7 @@ class ReportingDeliveryAgent;
class ReportingEndpointManager;
class ReportingGarbageCollector;
class ReportingObserver;
+class ReportingPersister;
class ReportingUploader;
class URLRequestContext;
@@ -40,6 +41,16 @@ class NET_EXPORT ReportingContext {
~ReportingContext();
+ // Initializes the ReportingContext. This may take a while (e.g. it may
+ // involve reloading state persisted to disk). Should be called only once.
+ //
+ // Components of the ReportingContext won't reference their dependencies (e.g.
+ // the Clock/TickClock or Timers inside the individual components) until
+ // during/after the call to Init.
+ void Initialize();
+
+ bool initialized() const { return initialized_; }
+
const ReportingPolicy& policy() { return policy_; }
ReportingDelegate* delegate() { return delegate_.get(); }
@@ -56,6 +67,8 @@ class NET_EXPORT ReportingContext {
return garbage_collector_.get();
}
+ ReportingPersister* persister() { return persister_.get(); }
+
void AddObserver(ReportingObserver* observer);
void RemoveObserver(ReportingObserver* observer);
@@ -77,6 +90,7 @@ class NET_EXPORT ReportingContext {
std::unique_ptr<ReportingUploader> uploader_;
base::ObserverList<ReportingObserver, /* check_empty= */ true> observers_;
+ bool initialized_;
std::unique_ptr<ReportingCache> cache_;
@@ -87,6 +101,10 @@ class NET_EXPORT ReportingContext {
// and |endpoint_manager_|.
std::unique_ptr<ReportingDeliveryAgent> delivery_agent_;
+ // |persister_| must come after |delegate_|, |clock_|, |tick_clock_|, and
+ // |cache_|.
+ std::unique_ptr<ReportingPersister> persister_;
+
// |garbage_collector_| must come after |tick_clock_| and |cache_|.
std::unique_ptr<ReportingGarbageCollector> garbage_collector_;
« no previous file with comments | « net/BUILD.gn ('k') | net/reporting/reporting_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698