| 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();
|
| }
|
|
|