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

Side by Side Diff: net/reporting/reporting_delivery_agent.cc

Issue 2835923005: Reporting: Remove persistence for now. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « net/reporting/reporting_delivery_agent.h ('k') | net/reporting/reporting_garbage_collector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/reporting/reporting_delivery_agent.h" 5 #include "net/reporting/reporting_delivery_agent.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 : context_(context), 55 : context_(context),
56 timer_(base::MakeUnique<base::OneShotTimer>()), 56 timer_(base::MakeUnique<base::OneShotTimer>()),
57 weak_factory_(this) { 57 weak_factory_(this) {
58 context_->AddObserver(this); 58 context_->AddObserver(this);
59 } 59 }
60 60
61 // ReportingDeliveryAgent implementation: 61 // ReportingDeliveryAgent implementation:
62 62
63 ~ReportingDeliveryAgentImpl() override { context_->RemoveObserver(this); } 63 ~ReportingDeliveryAgentImpl() override { context_->RemoveObserver(this); }
64 64
65 void Initialize() override {
66 if (CacheHasReports())
67 StartTimer();
68 }
69
70 void SetTimerForTesting(std::unique_ptr<base::Timer> timer) override { 65 void SetTimerForTesting(std::unique_ptr<base::Timer> timer) override {
71 DCHECK(!timer_->IsRunning()); 66 DCHECK(!timer_->IsRunning());
72 timer_ = std::move(timer); 67 timer_ = std::move(timer);
73 } 68 }
74 69
75 // ReportingObserver implementation: 70 // ReportingObserver implementation:
76 void OnCacheUpdated() override { 71 void OnCacheUpdated() override {
77 if (CacheHasReports()) 72 if (CacheHasReports())
78 StartTimer(); 73 StartTimer();
79 } 74 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 207
213 // static 208 // static
214 std::unique_ptr<ReportingDeliveryAgent> ReportingDeliveryAgent::Create( 209 std::unique_ptr<ReportingDeliveryAgent> ReportingDeliveryAgent::Create(
215 ReportingContext* context) { 210 ReportingContext* context) {
216 return base::MakeUnique<ReportingDeliveryAgentImpl>(context); 211 return base::MakeUnique<ReportingDeliveryAgentImpl>(context);
217 } 212 }
218 213
219 ReportingDeliveryAgent::~ReportingDeliveryAgent() {} 214 ReportingDeliveryAgent::~ReportingDeliveryAgent() {}
220 215
221 } // namespace net 216 } // namespace net
OLDNEW
« no previous file with comments | « net/reporting/reporting_delivery_agent.h ('k') | net/reporting/reporting_garbage_collector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698