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

Unified Diff: net/reporting/reporting_garbage_collector.cc

Issue 2769083005: Reporting: Set up in ProfileImplIOData. (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/reporting/reporting_feature.cc ('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 b6486b4cc0438ac742dcdd997f7c5b97feffd3f3..a8cabe1a2dd4287ede1bc06a7d4e6d91e88cc332 100644
--- a/net/reporting/reporting_garbage_collector.cc
+++ b/net/reporting/reporting_garbage_collector.cc
@@ -40,17 +40,15 @@ class ReportingGarbageCollectorImpl : public ReportingGarbageCollector,
// ReportingObserver implementation:
void OnCacheUpdated() override {
- if (!timer_->IsRunning())
- StartTimer();
- }
+ if (timer_->IsRunning())
+ return;
- private:
- void StartTimer() {
timer_->Start(FROM_HERE, context_->policy().garbage_collection_interval,
base::Bind(&ReportingGarbageCollectorImpl::CollectGarbage,
base::Unretained(this)));
}
+ private:
void CollectGarbage() {
base::TimeTicks now = context_->tick_clock()->NowTicks();
const ReportingPolicy& policy = context_->policy();
« no previous file with comments | « net/reporting/reporting_feature.cc ('k') | net/reporting/reporting_persister.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698