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

Unified Diff: net/reporting/reporting_context.h

Issue 2740833004: Reporting: Implement garbage collector. (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 9239cbb8d6e4d4b152d2d1f7006346d03b59a083..125c221865c773f4db5964bfd0b9383cba15dae2 100644
--- a/net/reporting/reporting_context.h
+++ b/net/reporting/reporting_context.h
@@ -16,6 +16,7 @@
namespace base {
class Clock;
class TickClock;
+class Timer;
} // namespace base
namespace net {
@@ -24,6 +25,7 @@ class ReportingCache;
class ReportingDelegate;
class ReportingDeliveryAgent;
class ReportingEndpointManager;
+class ReportingGarbageCollector;
class ReportingObserver;
class ReportingUploader;
class URLRequestContext;
@@ -44,6 +46,9 @@ class NET_EXPORT ReportingContext {
base::Clock* clock() { return clock_.get(); }
base::TickClock* tick_clock() { return tick_clock_.get(); }
+ base::Timer* garbage_collection_timer() {
+ return garbage_collection_timer_.get();
+ }
ReportingUploader* uploader() { return uploader_.get(); }
ReportingCache* cache() { return cache_.get(); }
@@ -51,6 +56,9 @@ class NET_EXPORT ReportingContext {
return endpoint_manager_.get();
}
ReportingDeliveryAgent* delivery_agent() { return delivery_agent_.get(); }
+ ReportingGarbageCollector* garbage_collector() {
+ return garbage_collector_.get();
+ }
void AddObserver(ReportingObserver* observer);
void RemoveObserver(ReportingObserver* observer);
@@ -63,6 +71,7 @@ class NET_EXPORT ReportingContext {
void Init(std::unique_ptr<ReportingDelegate> delegate,
std::unique_ptr<base::Clock> clock,
std::unique_ptr<base::TickClock> tick_clock,
+ std::unique_ptr<base::Timer> garbage_collection_timer,
std::unique_ptr<ReportingUploader> uploader);
private:
@@ -71,6 +80,7 @@ class NET_EXPORT ReportingContext {
std::unique_ptr<base::Clock> clock_;
std::unique_ptr<base::TickClock> tick_clock_;
+ std::unique_ptr<base::Timer> garbage_collection_timer_;
shivanisha 2017/04/05 16:44:05 Since the garbage_collector_ object is responsible
std::unique_ptr<ReportingUploader> uploader_;
base::ObserverList<ReportingObserver, /* check_empty= */ true> observers_;
@@ -84,6 +94,10 @@ class NET_EXPORT ReportingContext {
// and |endpoint_manager_|.
std::unique_ptr<ReportingDeliveryAgent> delivery_agent_;
+ // |garbage_collector_| must come after |tick_clock_|,
+ // |garbage_collection_timer_|, and |cache_|.
+ std::unique_ptr<ReportingGarbageCollector> garbage_collector_;
+
DISALLOW_COPY_AND_ASSIGN(ReportingContext);
};
« 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