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

Unified Diff: net/reporting/reporting_context.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_context.h ('k') | net/reporting/reporting_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_context.cc
diff --git a/net/reporting/reporting_context.cc b/net/reporting/reporting_context.cc
index 047a4a34306c7dec70382485034008ad2d8d8b15..c6f01fd1f30715fcb6b508be1e02c4cfe54377f5 100644
--- a/net/reporting/reporting_context.cc
+++ b/net/reporting/reporting_context.cc
@@ -15,7 +15,6 @@
#include "base/time/time.h"
#include "net/base/backoff_entry.h"
#include "net/reporting/reporting_cache.h"
-#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_delivery_agent.h"
#include "net/reporting/reporting_endpoint_manager.h"
#include "net/reporting/reporting_garbage_collector.h"
@@ -34,10 +33,8 @@ namespace {
class ReportingContextImpl : public ReportingContext {
public:
ReportingContextImpl(const ReportingPolicy& policy,
- std::unique_ptr<ReportingDelegate> delegate,
URLRequestContext* request_context)
: ReportingContext(policy,
- std::move(delegate),
base::MakeUnique<base::DefaultClock>(),
base::MakeUnique<base::DefaultTickClock>(),
ReportingUploader::Create(request_context)) {}
@@ -48,29 +45,12 @@ class ReportingContextImpl : public ReportingContext {
// static
std::unique_ptr<ReportingContext> ReportingContext::Create(
const ReportingPolicy& policy,
- std::unique_ptr<ReportingDelegate> delegate,
URLRequestContext* request_context) {
- return base::MakeUnique<ReportingContextImpl>(policy, std::move(delegate),
- request_context);
+ return base::MakeUnique<ReportingContextImpl>(policy, request_context);
}
ReportingContext::~ReportingContext() {}
-void ReportingContext::Initialize() {
- DCHECK(!initialized_);
-
- // This order isn't *critical*, but things will work better with it in this
- // order: with the DeliveryAgent after the Persister, it can schedule delivery
- // of persisted reports instead of waiting for a new one to be generated, and
- // with the GarbageCollector in between, it won't bother scheduling delivery
- // of reports that should be discarded instead.
- persister_->Initialize();
- garbage_collector_->Initialize();
- delivery_agent_->Initialize();
-
- initialized_ = true;
-}
-
void ReportingContext::AddObserver(ReportingObserver* observer) {
DCHECK(!observers_.HasObserver(observer));
observers_.AddObserver(observer);
@@ -82,24 +62,18 @@ void ReportingContext::RemoveObserver(ReportingObserver* observer) {
}
void ReportingContext::NotifyCacheUpdated() {
- if (!initialized_)
- return;
-
for (auto& observer : observers_)
observer.OnCacheUpdated();
}
ReportingContext::ReportingContext(const ReportingPolicy& policy,
- std::unique_ptr<ReportingDelegate> delegate,
std::unique_ptr<base::Clock> clock,
std::unique_ptr<base::TickClock> tick_clock,
std::unique_ptr<ReportingUploader> uploader)
: policy_(policy),
- delegate_(std::move(delegate)),
clock_(std::move(clock)),
tick_clock_(std::move(tick_clock)),
uploader_(std::move(uploader)),
- initialized_(false),
cache_(base::MakeUnique<ReportingCache>(this)),
endpoint_manager_(base::MakeUnique<ReportingEndpointManager>(this)),
delivery_agent_(ReportingDeliveryAgent::Create(this)),
« no previous file with comments | « net/reporting/reporting_context.h ('k') | net/reporting/reporting_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698