Commit 42c57319 authored by juliatuttle's avatar juliatuttle Committed by Commit bot

Reporting: Remove persistence for now.

I'm going to build a general persistence mechanism for //net instead of
tediously plumbing out to the profile's prefs (which gets really messy
with isolated app contexts and such), so I'm removing the old
persistence stuff until that's done.

BUG=704259

Review-Url: https://codereview.chromium.org/2835923005
Cr-Commit-Position: refs/heads/master@{#467862}
parent c045c21a
......@@ -1424,8 +1424,6 @@ component("net") {
"reporting/reporting_client.h",
"reporting/reporting_context.cc",
"reporting/reporting_context.h",
"reporting/reporting_delegate.cc",
"reporting/reporting_delegate.h",
"reporting/reporting_delivery_agent.cc",
"reporting/reporting_delivery_agent.h",
"reporting/reporting_endpoint_manager.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)),
......
......@@ -21,7 +21,6 @@ class TickClock;
namespace net {
class ReportingCache;
class ReportingDelegate;
class ReportingDeliveryAgent;
class ReportingEndpointManager;
class ReportingGarbageCollector;
......@@ -37,23 +36,11 @@ class NET_EXPORT ReportingContext {
public:
static std::unique_ptr<ReportingContext> Create(
const ReportingPolicy& policy,
std::unique_ptr<ReportingDelegate> delegate,
URLRequestContext* request_context);
~ReportingContext();
// Initializes the ReportingContext. This may take a while (e.g. it may
// involve reloading state persisted to disk). Should be called only once.
//
// Components of the ReportingContext won't reference their dependencies (e.g.
// the Clock/TickClock or Timers inside the individual components) until
// during/after the call to Init.
void Initialize();
bool initialized() const { return initialized_; }
const ReportingPolicy& policy() { return policy_; }
ReportingDelegate* delegate() { return delegate_.get(); }
base::Clock* clock() { return clock_.get(); }
base::TickClock* tick_clock() { return tick_clock_.get(); }
......@@ -77,21 +64,18 @@ class NET_EXPORT ReportingContext {
protected:
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);
private:
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_;
base::ObserverList<ReportingObserver, /* check_empty= */ true> observers_;
bool initialized_;
std::unique_ptr<ReportingCache> cache_;
......@@ -102,8 +86,7 @@ class NET_EXPORT ReportingContext {
// and |endpoint_manager_|.
std::unique_ptr<ReportingDeliveryAgent> delivery_agent_;
// |persister_| must come after |delegate_|, |clock_|, |tick_clock_|, and
// |cache_|.
// |persister_| must come after |clock_|, |tick_clock_|, and |cache_|.
std::unique_ptr<ReportingPersister> persister_;
// |garbage_collector_| must come after |tick_clock_| and |cache_|.
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/reporting/reporting_delegate.h"
namespace net {
ReportingDelegate::~ReportingDelegate() {}
ReportingDelegate::ReportingDelegate() {}
} // namespace net
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_REPORTING_REPORTING_DELEGATE_H_
#define NET_REPORTING_REPORTING_DELEGATE_H_
#include <memory>
#include "base/macros.h"
#include "net/base/net_export.h"
namespace base {
class Value;
} // namespace base
namespace net {
// Delegate for things that the Reporting system can't do by itself, like
// persisting data across embedder restarts.
class NET_EXPORT ReportingDelegate {
public:
virtual ~ReportingDelegate();
// Gets previously persisted data, if any is available. Returns a null pointer
// if no data is available. Can be called any number of times.
virtual std::unique_ptr<const base::Value> GetPersistedData() = 0;
// Sets data to be persisted across embedder restarts. Ideally, this data will
// be returned by any future calls to GetPersistedData() in this or future
// sessions (until newer data is persisted), but no guarantee is made, since
// the underlying persistence mechanism may or may not be reliable.
virtual void PersistData(
std::unique_ptr<const base::Value> persisted_data) = 0;
protected:
ReportingDelegate();
private:
DISALLOW_COPY_AND_ASSIGN(ReportingDelegate);
};
} // namespace net
#endif // NET_REPORTING_REPORTING_DELEGATE_H_
......@@ -62,11 +62,6 @@ class ReportingDeliveryAgentImpl : public ReportingDeliveryAgent,
~ReportingDeliveryAgentImpl() override { context_->RemoveObserver(this); }
void Initialize() override {
if (CacheHasReports())
StartTimer();
}
void SetTimerForTesting(std::unique_ptr<base::Timer> timer) override {
DCHECK(!timer_->IsRunning());
timer_ = std::move(timer);
......
......@@ -55,11 +55,6 @@ class NET_EXPORT ReportingDeliveryAgent {
virtual ~ReportingDeliveryAgent();
// Initializes the DeliveryAgent, which schedules delivery (after the Policy's
// delivery_interval) for any previously-persisted reports that can still be
// delivered.
virtual void Initialize() = 0;
// Replaces the internal Timer used for scheduling report delivery attempts
// with a caller-specified one so that unittests can provide a MockTimer.
virtual void SetTimerForTesting(std::unique_ptr<base::Timer> timer) = 0;
......
......@@ -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();
}
......
......@@ -28,10 +28,6 @@ class NET_EXPORT ReportingGarbageCollector {
virtual ~ReportingGarbageCollector();
// Initializes the GarbageCollector, which performs an initial garbage
// collection pass over any data already in the Cache.
virtual void Initialize() = 0;
// Replaces the internal Timer used for scheduling garbage collection passes
// with a caller-specified one so that unittests can provide a MockTimer.
virtual void SetTimerForTesting(std::unique_ptr<base::Timer> timer) = 0;
......
......@@ -16,7 +16,6 @@
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_client.h"
#include "net/reporting/reporting_context.h"
#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_observer.h"
#include "net/reporting/reporting_policy.h"
#include "net/reporting/reporting_report.h"
......@@ -61,49 +60,15 @@ bool DeserializeOrigin(const base::DictionaryValue& serialized,
return true;
}
class ReportingPersisterImpl : public ReportingPersister,
public ReportingObserver {
class ReportingPersisterImpl : public ReportingPersister {
public:
ReportingPersisterImpl(ReportingContext* context)
: context_(context), timer_(base::MakeUnique<base::OneShotTimer>()) {}
ReportingPersisterImpl(ReportingContext* context) : context_(context) {}
// ReportingPersister implementation:
~ReportingPersisterImpl() override {
DCHECK(context_->initialized());
context_->RemoveObserver(this);
}
void Initialize() override {
std::unique_ptr<const base::Value> persisted_data =
context_->delegate()->GetPersistedData();
if (persisted_data)
Deserialize(*persisted_data);
context_->AddObserver(this);
}
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();
}
~ReportingPersisterImpl() override {}
private:
void StartTimer() {
timer_->Start(
FROM_HERE, context_->policy().persistence_interval,
base::Bind(&ReportingPersisterImpl::Persist, base::Unretained(this)));
}
void Persist() { delegate()->PersistData(Serialize()); }
std::string SerializeTicks(base::TimeTicks time_ticks) {
base::Time time = time_ticks - tick_clock()->NowTicks() + clock()->Now();
return base::Int64ToString(time.ToInternalValue());
......@@ -336,13 +301,11 @@ class ReportingPersisterImpl : public ReportingPersister,
}
const ReportingPolicy& policy() { return context_->policy(); }
ReportingDelegate* delegate() { return context_->delegate(); }
base::Clock* clock() { return context_->clock(); }
base::TickClock* tick_clock() { return context_->tick_clock(); }
ReportingCache* cache() { return context_->cache(); }
ReportingContext* context_;
std::unique_ptr<base::Timer> timer_;
};
} // namespace
......
......@@ -9,30 +9,18 @@
#include "net/base/net_export.h"
namespace base {
class Timer;
} // namespace base
namespace net {
class ReportingContext;
// Periodically persists the state of the Reporting system to (reasonably)
// stable storage using the methods provided by the ReportingDelegate.
// Will persist the state of the Reporting system to (reasonably) stable
// storage using an as-yet-unwritten persistence mechanism within //net.
class NET_EXPORT ReportingPersister {
public:
// Creates a ReportingPersister. |context| must outlive the persister.
static std::unique_ptr<ReportingPersister> Create(ReportingContext* context);
virtual ~ReportingPersister();
// Initializes the Persister, which deserializes any previously-persisted data
// that is available through the Context's Delegate.
virtual void Initialize() = 0;
// Replaces the internal Timer used for scheduling writes to stable storage
// with a caller-specified one so that unittests can provide a MockTimer.
virtual void SetTimerForTesting(std::unique_ptr<base::Timer> timer) = 0;
};
} // namespace net
......
......@@ -30,7 +30,8 @@ class ReportingPersisterTest : public ReportingTestBase {
const std::string kType_ = "default";
};
TEST_F(ReportingPersisterTest, Test) {
// Disabled because the Persister has no persistence layer to use yet.
TEST_F(ReportingPersisterTest, DISABLED_Test) {
ReportingPolicy policy;
policy.persist_reports_across_restarts = true;
policy.persist_clients_across_restarts = true;
......@@ -49,8 +50,7 @@ TEST_F(ReportingPersisterTest, Test) {
kGroup_,
tick_clock()->NowTicks() + base::TimeDelta::FromDays(1));
EXPECT_TRUE(persistence_timer()->IsRunning());
persistence_timer()->Fire();
// TODO: Actually trigger persistence, once it's possible.
SimulateRestart(/* delta= */ base::TimeDelta::FromHours(1),
/* delta_ticks= */ base::TimeDelta::FromHours(-3));
......
......@@ -14,7 +14,6 @@
#include "base/values.h"
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_context.h"
#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_header_parser.h"
#include "url/gurl.h"
......@@ -25,11 +24,7 @@ namespace {
class ReportingServiceImpl : public ReportingService {
public:
ReportingServiceImpl(std::unique_ptr<ReportingContext> context)
: context_(std::move(context)) {
// TODO(juliatuttle): This can be slow, so it might be better to expose it
// as a separate method and call it separately from constructing everything.
context_->Initialize();
}
: context_(std::move(context)) {}
~ReportingServiceImpl() override {}
......@@ -37,14 +32,12 @@ class ReportingServiceImpl : public ReportingService {
const std::string& group,
const std::string& type,
std::unique_ptr<const base::Value> body) override {
DCHECK(context_->initialized());
context_->cache()->AddReport(url, group, type, std::move(body),
context_->tick_clock()->NowTicks(), 0);
}
void ProcessHeader(const GURL& url,
const std::string& header_value) override {
DCHECK(context_->initialized());
ReportingHeaderParser::ParseHeader(context_.get(), url, header_value);
}
......@@ -61,10 +54,9 @@ ReportingService::~ReportingService() {}
// static
std::unique_ptr<ReportingService> ReportingService::Create(
const ReportingPolicy& policy,
URLRequestContext* request_context,
std::unique_ptr<ReportingDelegate> delegate) {
URLRequestContext* request_context) {
return base::MakeUnique<ReportingServiceImpl>(
ReportingContext::Create(policy, std::move(delegate), request_context));
ReportingContext::Create(policy, request_context));
}
// static
......
......@@ -21,7 +21,6 @@ class Value;
namespace net {
class ReportingContext;
class ReportingDelegate;
struct ReportingPolicy;
class URLRequestContext;
......@@ -32,12 +31,10 @@ class NET_EXPORT ReportingService {
virtual ~ReportingService();
// Creates a ReportingService. |policy| will be copied. |request_context| must
// outlive the ReportingService. The ReportingService will take ownership of
// |delegate| and destroy it when the service is destroyed.
// outlive the ReportingService.
static std::unique_ptr<ReportingService> Create(
const ReportingPolicy& policy,
URLRequestContext* request_context,
std::unique_ptr<ReportingDelegate> delegate);
URLRequestContext* request_context);
// Creates a ReportingService for testing purposes using an
// already-constructed ReportingContext. The ReportingService will take
......
......@@ -12,7 +12,6 @@
#include "base/values.h"
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_context.h"
#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_policy.h"
#include "net/reporting/reporting_report.h"
#include "net/reporting/reporting_service.h"
......
......@@ -17,7 +17,6 @@
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_client.h"
#include "net/reporting/reporting_context.h"
#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_delivery_agent.h"
#include "net/reporting/reporting_garbage_collector.h"
#include "net/reporting/reporting_persister.h"
......@@ -91,20 +90,6 @@ const ReportingClient* FindClientInCache(const ReportingCache* cache,
return nullptr;
}
TestReportingDelegate::TestReportingDelegate() {}
TestReportingDelegate::~TestReportingDelegate() {}
void TestReportingDelegate::PersistData(
std::unique_ptr<const base::Value> persisted_data) {
persisted_data_ = std::move(persisted_data);
}
std::unique_ptr<const base::Value> TestReportingDelegate::GetPersistedData() {
if (!persisted_data_)
return std::unique_ptr<const base::Value>();
return persisted_data_->CreateDeepCopy();
}
TestReportingUploader::PendingUpload::~PendingUpload() {}
TestReportingUploader::PendingUpload::PendingUpload() {}
......@@ -120,18 +105,14 @@ void TestReportingUploader::StartUpload(const GURL& url,
TestReportingContext::TestReportingContext(const ReportingPolicy& policy)
: ReportingContext(policy,
base::MakeUnique<TestReportingDelegate>(),
base::MakeUnique<base::SimpleTestClock>(),
base::MakeUnique<base::SimpleTestTickClock>(),
base::MakeUnique<TestReportingUploader>()),
delivery_timer_(new base::MockTimer(/* retain_user_task= */ false,
/* is_repeating= */ false)),
persistence_timer_(new base::MockTimer(/* retain_user_task= */ false,
/* is_repeating= */ false)),
garbage_collection_timer_(
new base::MockTimer(/* retain_user_task= */ false,
/* is_repeating= */ false)) {
persister()->SetTimerForTesting(base::WrapUnique(persistence_timer_));
garbage_collector()->SetTimerForTesting(
base::WrapUnique(garbage_collection_timer_));
delivery_agent()->SetTimerForTesting(base::WrapUnique(delivery_timer_));
......@@ -139,7 +120,6 @@ TestReportingContext::TestReportingContext(const ReportingPolicy& policy)
TestReportingContext::~TestReportingContext() {
delivery_timer_ = nullptr;
persistence_timer_ = nullptr;
garbage_collection_timer_ = nullptr;
}
......@@ -148,34 +128,27 @@ ReportingTestBase::ReportingTestBase() {
ReportingPolicy policy;
policy.endpoint_backoff_policy.jitter_factor = 0.0;
CreateAndInitializeContext(policy, std::unique_ptr<const base::Value>(),
base::Time::Now(), base::TimeTicks::Now());
CreateContext(policy, base::Time::Now(), base::TimeTicks::Now());
}
ReportingTestBase::~ReportingTestBase() {}
void ReportingTestBase::UsePolicy(const ReportingPolicy& new_policy) {
CreateAndInitializeContext(new_policy, delegate()->GetPersistedData(),
clock()->Now(), tick_clock()->NowTicks());
CreateContext(new_policy, clock()->Now(), tick_clock()->NowTicks());
}
void ReportingTestBase::SimulateRestart(base::TimeDelta delta,
base::TimeDelta delta_ticks) {
CreateAndInitializeContext(policy(), delegate()->GetPersistedData(),
clock()->Now() + delta,
tick_clock()->NowTicks() + delta_ticks);
CreateContext(policy(), clock()->Now() + delta,
tick_clock()->NowTicks() + delta_ticks);
}
void ReportingTestBase::CreateAndInitializeContext(
const ReportingPolicy& policy,
std::unique_ptr<const base::Value> persisted_data,
base::Time now,
base::TimeTicks now_ticks) {
void ReportingTestBase::CreateContext(const ReportingPolicy& policy,
base::Time now,
base::TimeTicks now_ticks) {
context_ = base::MakeUnique<TestReportingContext>(policy);
delegate()->PersistData(std::move(persisted_data));
clock()->SetNow(now);
tick_clock()->SetNowTicks(now_ticks);
context_->Initialize();
}
base::TimeTicks ReportingTestBase::yesterday() {
......
......@@ -11,7 +11,6 @@
#include "base/macros.h"
#include "net/reporting/reporting_context.h"
#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_uploader.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -40,24 +39,6 @@ const ReportingClient* FindClientInCache(const ReportingCache* cache,
const url::Origin& origin,
const GURL& endpoint);
// A simple implementation of ReportingDelegate that only persists data in RAM.
class TestReportingDelegate : public ReportingDelegate {
public:
TestReportingDelegate();
~TestReportingDelegate() override;
// ReportingDelegate implementation:
std::unique_ptr<const base::Value> GetPersistedData() override;
void PersistData(std::unique_ptr<const base::Value> persisted_data) override;
private:
std::unique_ptr<const base::Value> persisted_data_;
DISALLOW_COPY_AND_ASSIGN(TestReportingDelegate);
};
// A test implementation of ReportingUploader that holds uploads for tests to
// examine and complete with a specified outcome.
class TestReportingUploader : public ReportingUploader {
......@@ -95,15 +76,12 @@ class TestReportingUploader : public ReportingUploader {
};
// A test implementation of ReportingContext that uses test versions of
// ReportingDelegate, Clock, TickClock, and ReportingUploader.
// Clock, TickClock, Timer, and ReportingUploader.
class TestReportingContext : public ReportingContext {
public:
TestReportingContext(const ReportingPolicy& policy);
~TestReportingContext();
TestReportingDelegate* test_delegate() {
return reinterpret_cast<TestReportingDelegate*>(delegate());
}
base::SimpleTestClock* test_clock() {
return reinterpret_cast<base::SimpleTestClock*>(clock());
}
......@@ -111,7 +89,6 @@ class TestReportingContext : public ReportingContext {
return reinterpret_cast<base::SimpleTestTickClock*>(tick_clock());
}
base::MockTimer* test_delivery_timer() { return delivery_timer_; }
base::MockTimer* test_persistence_timer() { return persistence_timer_; }
base::MockTimer* test_garbage_collection_timer() {
return garbage_collection_timer_;
}
......@@ -124,7 +101,6 @@ class TestReportingContext : public ReportingContext {
// here to preserve type:
base::MockTimer* delivery_timer_;
base::MockTimer* persistence_timer_;
base::MockTimer* garbage_collection_timer_;
DISALLOW_COPY_AND_ASSIGN(TestReportingContext);
......@@ -139,8 +115,7 @@ class ReportingTestBase : public ::testing::Test {
void UsePolicy(const ReportingPolicy& policy);
// Simulates an embedder restart, preserving the ReportingPolicy and any data
// persisted via the TestReportingDelegate, but nothing else.
// Simulates an embedder restart, preserving the ReportingPolicy.
//
// Advances the Clock by |delta|, and the TickClock by |delta_ticks|. Both can
// be zero or negative.
......@@ -150,15 +125,11 @@ class ReportingTestBase : public ::testing::Test {
const ReportingPolicy& policy() { return context_->policy(); }
TestReportingDelegate* delegate() { return context_->test_delegate(); }
base::SimpleTestClock* clock() { return context_->test_clock(); }
base::SimpleTestTickClock* tick_clock() {
return context_->test_tick_clock();
}
base::MockTimer* delivery_timer() { return context_->test_delivery_timer(); }
base::MockTimer* persistence_timer() {
return context_->test_persistence_timer();
}
base::MockTimer* garbage_collection_timer() {
return context_->test_garbage_collection_timer();
}
......@@ -187,11 +158,9 @@ class ReportingTestBase : public ::testing::Test {
}
private:
void CreateAndInitializeContext(
const ReportingPolicy& policy,
std::unique_ptr<const base::Value> persisted_data,
base::Time now,
base::TimeTicks now_ticks);
void CreateContext(const ReportingPolicy& policy,
base::Time now,
base::TimeTicks now_ticks);
std::unique_ptr<TestReportingContext> context_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment