| 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)),
|
|
|