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

Unified Diff: net/reporting/reporting_garbage_collector.cc

Issue 2835923005: Reporting: Remove persistence for now. (Closed)
Patch Set: 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_garbage_collector.h ('k') | net/reporting/reporting_persister.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_garbage_collector.cc
diff --git a/net/reporting/reporting_garbage_collector.cc b/net/reporting/reporting_garbage_collector.cc
index 76dbf3ad0e4401c5d7db7747db4c2b54012065af..b6486b4cc0438ac742dcdd997f7c5b97feffd3f3 100644
--- a/net/reporting/reporting_garbage_collector.cc
+++ b/net/reporting/reporting_garbage_collector.cc
@@ -24,28 +24,22 @@ class ReportingGarbageCollectorImpl : public ReportingGarbageCollector,
public ReportingObserver {
public:
ReportingGarbageCollectorImpl(ReportingContext* context)
- : context_(context), timer_(base::MakeUnique<base::OneShotTimer>()) {}
+ : context_(context), timer_(base::MakeUnique<base::OneShotTimer>()) {
+ context_->AddObserver(this);
+ }
// ReportingGarbageCollector implementation:
~ReportingGarbageCollectorImpl() override {
- DCHECK(context_->initialized());
context_->RemoveObserver(this);
}
- void Initialize() override {
- context_->AddObserver(this);
- CollectGarbage();
- }
-
void SetTimerForTesting(std::unique_ptr<base::Timer> timer) override {
- DCHECK(!context_->initialized());
timer_ = std::move(timer);
}
// ReportingObserver implementation:
void OnCacheUpdated() override {
- DCHECK(context_->initialized());
if (!timer_->IsRunning())
StartTimer();
}
« no previous file with comments | « net/reporting/reporting_garbage_collector.h ('k') | net/reporting/reporting_persister.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698