Commit 806691b1 authored by Chris Watkins's avatar Chris Watkins Committed by Commit Bot

Run clang-tidy modernize-use-equals-{delete,default} on //net/reporting

See the bugs and cxx post for justification and details:
https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8

This change was done using clang-tidy as described here:
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md

In some cases the the tool leaves behind a string of commas where it
replaced a member initializer list
(https://bugs.llvm.org/show_bug.cgi?id=35051). They were cleaned up with:
  git diff --name-only | \
    xargs sed -E -i 's/(^\s*|\)\s*):[ ,]*= default/\1 = default/'

BUG=778959,778957
This CL was uploaded by git cl split.

R=juliatuttle@chromium.org

Change-Id: Ib3962b07d49ab4e0032abc2fa61fa35faee70971
Reviewed-on: https://chromium-review.googlesource.com/799590Reviewed-by: default avatarJulia Tuttle <juliatuttle@chromium.org>
Commit-Queue: Chris Watkins <watk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520866}
parent 813190a7
...@@ -464,6 +464,6 @@ std::unique_ptr<ReportingCache> ReportingCache::Create( ...@@ -464,6 +464,6 @@ std::unique_ptr<ReportingCache> ReportingCache::Create(
return std::make_unique<ReportingCacheImpl>(context); return std::make_unique<ReportingCacheImpl>(context);
} }
ReportingCache::~ReportingCache() {} ReportingCache::~ReportingCache() = default;
} // namespace net } // namespace net
...@@ -23,6 +23,6 @@ ReportingClient::ReportingClient(const url::Origin& origin, ...@@ -23,6 +23,6 @@ ReportingClient::ReportingClient(const url::Origin& origin,
group(group), group(group),
expires(expires) {} expires(expires) {}
ReportingClient::~ReportingClient() {} ReportingClient::~ReportingClient() = default;
} // namespace net } // namespace net
...@@ -50,7 +50,7 @@ std::unique_ptr<ReportingContext> ReportingContext::Create( ...@@ -50,7 +50,7 @@ std::unique_ptr<ReportingContext> ReportingContext::Create(
return std::make_unique<ReportingContextImpl>(policy, request_context); return std::make_unique<ReportingContextImpl>(policy, request_context);
} }
ReportingContext::~ReportingContext() {} ReportingContext::~ReportingContext() = default;
void ReportingContext::AddObserver(ReportingObserver* observer) { void ReportingContext::AddObserver(ReportingObserver* observer) {
DCHECK(!observers_.HasObserver(observer)); DCHECK(!observers_.HasObserver(observer));
......
...@@ -18,7 +18,7 @@ class ReportingDelegateImpl : public ReportingDelegate { ...@@ -18,7 +18,7 @@ class ReportingDelegateImpl : public ReportingDelegate {
DCHECK(request_context); DCHECK(request_context);
} }
~ReportingDelegateImpl() override {} ~ReportingDelegateImpl() override = default;
bool CanQueueReport(const url::Origin& origin) const override { bool CanQueueReport(const url::Origin& origin) const override {
return network_delegate() && return network_delegate() &&
...@@ -58,6 +58,6 @@ std::unique_ptr<ReportingDelegate> ReportingDelegate::Create( ...@@ -58,6 +58,6 @@ std::unique_ptr<ReportingDelegate> ReportingDelegate::Create(
return std::make_unique<ReportingDelegateImpl>(request_context); return std::make_unique<ReportingDelegateImpl>(request_context);
} }
ReportingDelegate::~ReportingDelegate() {} ReportingDelegate::~ReportingDelegate() = default;
} // namespace net } // namespace net
...@@ -81,7 +81,7 @@ class ReportingDeliveryAgentImpl : public ReportingDeliveryAgent, ...@@ -81,7 +81,7 @@ class ReportingDeliveryAgentImpl : public ReportingDeliveryAgent,
const std::vector<const ReportingReport*>& reports) const std::vector<const ReportingReport*>& reports)
: endpoint(endpoint), reports(reports) {} : endpoint(endpoint), reports(reports) {}
~Delivery() {} ~Delivery() = default;
const GURL endpoint; const GURL endpoint;
const std::vector<const ReportingReport*> reports; const std::vector<const ReportingReport*> reports;
...@@ -219,6 +219,6 @@ std::unique_ptr<ReportingDeliveryAgent> ReportingDeliveryAgent::Create( ...@@ -219,6 +219,6 @@ std::unique_ptr<ReportingDeliveryAgent> ReportingDeliveryAgent::Create(
return std::make_unique<ReportingDeliveryAgentImpl>(context); return std::make_unique<ReportingDeliveryAgentImpl>(context);
} }
ReportingDeliveryAgent::~ReportingDeliveryAgent() {} ReportingDeliveryAgent::~ReportingDeliveryAgent() = default;
} // namespace net } // namespace net
...@@ -30,7 +30,7 @@ class ReportingEndpointManagerImpl : public ReportingEndpointManager { ...@@ -30,7 +30,7 @@ class ReportingEndpointManagerImpl : public ReportingEndpointManager {
public: public:
ReportingEndpointManagerImpl(ReportingContext* context) : context_(context) {} ReportingEndpointManagerImpl(ReportingContext* context) : context_(context) {}
~ReportingEndpointManagerImpl() override {} ~ReportingEndpointManagerImpl() override = default;
bool FindEndpointForOriginAndGroup(const url::Origin& origin, bool FindEndpointForOriginAndGroup(const url::Origin& origin,
const std::string& group, const std::string& group,
...@@ -109,6 +109,6 @@ std::unique_ptr<ReportingEndpointManager> ReportingEndpointManager::Create( ...@@ -109,6 +109,6 @@ std::unique_ptr<ReportingEndpointManager> ReportingEndpointManager::Create(
return std::make_unique<ReportingEndpointManagerImpl>(context); return std::make_unique<ReportingEndpointManagerImpl>(context);
} }
ReportingEndpointManager::~ReportingEndpointManager() {} ReportingEndpointManager::~ReportingEndpointManager() = default;
} // namespace net } // namespace net
...@@ -86,6 +86,6 @@ std::unique_ptr<ReportingGarbageCollector> ReportingGarbageCollector::Create( ...@@ -86,6 +86,6 @@ std::unique_ptr<ReportingGarbageCollector> ReportingGarbageCollector::Create(
return std::make_unique<ReportingGarbageCollectorImpl>(context); return std::make_unique<ReportingGarbageCollectorImpl>(context);
} }
ReportingGarbageCollector::~ReportingGarbageCollector() {} ReportingGarbageCollector::~ReportingGarbageCollector() = default;
} // namespace net } // namespace net
...@@ -60,6 +60,6 @@ ReportingNetworkChangeObserver::Create(ReportingContext* context) { ...@@ -60,6 +60,6 @@ ReportingNetworkChangeObserver::Create(ReportingContext* context) {
return std::make_unique<ReportingNetworkChangeObserverImpl>(context); return std::make_unique<ReportingNetworkChangeObserverImpl>(context);
} }
ReportingNetworkChangeObserver::~ReportingNetworkChangeObserver() {} ReportingNetworkChangeObserver::~ReportingNetworkChangeObserver() = default;
} // namespace net } // namespace net
...@@ -8,8 +8,8 @@ namespace net { ...@@ -8,8 +8,8 @@ namespace net {
void ReportingObserver::OnCacheUpdated() {} void ReportingObserver::OnCacheUpdated() {}
ReportingObserver::ReportingObserver() {} ReportingObserver::ReportingObserver() = default;
ReportingObserver::~ReportingObserver() {} ReportingObserver::~ReportingObserver() = default;
} // namespace net } // namespace net
...@@ -66,7 +66,7 @@ class ReportingPersisterImpl : public ReportingPersister { ...@@ -66,7 +66,7 @@ class ReportingPersisterImpl : public ReportingPersister {
// ReportingPersister implementation: // ReportingPersister implementation:
~ReportingPersisterImpl() override {} ~ReportingPersisterImpl() override = default;
private: private:
std::string SerializeTicks(base::TimeTicks time_ticks) { std::string SerializeTicks(base::TimeTicks time_ticks) {
...@@ -316,6 +316,6 @@ std::unique_ptr<ReportingPersister> ReportingPersister::Create( ...@@ -316,6 +316,6 @@ std::unique_ptr<ReportingPersister> ReportingPersister::Create(
return std::make_unique<ReportingPersisterImpl>(context); return std::make_unique<ReportingPersisterImpl>(context);
} }
ReportingPersister::~ReportingPersister() {} ReportingPersister::~ReportingPersister() = default;
} // namespace net } // namespace net
...@@ -29,21 +29,8 @@ ReportingPolicy::ReportingPolicy() ...@@ -29,21 +29,8 @@ ReportingPolicy::ReportingPolicy()
endpoint_backoff_policy.always_use_initial_delay = false; endpoint_backoff_policy.always_use_initial_delay = false;
} }
ReportingPolicy::ReportingPolicy(const ReportingPolicy& other) ReportingPolicy::ReportingPolicy(const ReportingPolicy& other) = default;
: max_report_count(other.max_report_count),
max_client_count(other.max_client_count),
delivery_interval(other.delivery_interval),
endpoint_backoff_policy(other.endpoint_backoff_policy),
persistence_interval(other.persistence_interval),
persist_reports_across_restarts(other.persist_reports_across_restarts),
persist_clients_across_restarts(other.persist_clients_across_restarts),
garbage_collection_interval(other.garbage_collection_interval),
max_report_age(other.max_report_age),
max_report_attempts(other.max_report_attempts),
clear_reports_on_network_changes(other.clear_reports_on_network_changes),
clear_clients_on_network_changes(other.clear_clients_on_network_changes) {
}
ReportingPolicy::~ReportingPolicy() {} ReportingPolicy::~ReportingPolicy() = default;
} // namespace net } // namespace net
...@@ -28,7 +28,7 @@ class ReportingServiceImpl : public ReportingService { ...@@ -28,7 +28,7 @@ class ReportingServiceImpl : public ReportingService {
ReportingServiceImpl(std::unique_ptr<ReportingContext> context) ReportingServiceImpl(std::unique_ptr<ReportingContext> context)
: context_(std::move(context)) {} : context_(std::move(context)) {}
~ReportingServiceImpl() override {} ~ReportingServiceImpl() override = default;
void QueueReport(const GURL& url, void QueueReport(const GURL& url,
const std::string& group, const std::string& group,
...@@ -61,7 +61,7 @@ class ReportingServiceImpl : public ReportingService { ...@@ -61,7 +61,7 @@ class ReportingServiceImpl : public ReportingService {
} // namespace } // namespace
ReportingService::~ReportingService() {} ReportingService::~ReportingService() = default;
// static // static
std::unique_ptr<ReportingService> ReportingService::Create( std::unique_ptr<ReportingService> ReportingService::Create(
......
...@@ -43,7 +43,7 @@ class PendingUploadImpl : public TestReportingUploader::PendingUpload { ...@@ -43,7 +43,7 @@ class PendingUploadImpl : public TestReportingUploader::PendingUpload {
callback_(callback), callback_(callback),
complete_callback_(complete_callback) {} complete_callback_(complete_callback) {}
~PendingUploadImpl() override {} ~PendingUploadImpl() override = default;
// PendingUpload implementationP: // PendingUpload implementationP:
const GURL& url() const override { return url_; } const GURL& url() const override { return url_; }
...@@ -91,11 +91,11 @@ const ReportingClient* FindClientInCache(const ReportingCache* cache, ...@@ -91,11 +91,11 @@ const ReportingClient* FindClientInCache(const ReportingCache* cache,
return nullptr; return nullptr;
} }
TestReportingUploader::PendingUpload::~PendingUpload() {} TestReportingUploader::PendingUpload::~PendingUpload() = default;
TestReportingUploader::PendingUpload::PendingUpload() {} TestReportingUploader::PendingUpload::PendingUpload() = default;
TestReportingUploader::TestReportingUploader() {} TestReportingUploader::TestReportingUploader() = default;
TestReportingUploader::~TestReportingUploader() {} TestReportingUploader::~TestReportingUploader() = default;
void TestReportingUploader::StartUpload(const GURL& url, void TestReportingUploader::StartUpload(const GURL& url,
const std::string& json, const std::string& json,
...@@ -104,9 +104,9 @@ void TestReportingUploader::StartUpload(const GURL& url, ...@@ -104,9 +104,9 @@ void TestReportingUploader::StartUpload(const GURL& url,
url, json, callback, base::Bind(&ErasePendingUpload, &pending_uploads_))); url, json, callback, base::Bind(&ErasePendingUpload, &pending_uploads_)));
} }
TestReportingDelegate::TestReportingDelegate() {} TestReportingDelegate::TestReportingDelegate() = default;
TestReportingDelegate::~TestReportingDelegate() {} TestReportingDelegate::~TestReportingDelegate() = default;
bool TestReportingDelegate::CanQueueReport(const url::Origin& origin) const { bool TestReportingDelegate::CanQueueReport(const url::Origin& origin) const {
return true; return true;
...@@ -155,7 +155,7 @@ ReportingTestBase::ReportingTestBase() { ...@@ -155,7 +155,7 @@ ReportingTestBase::ReportingTestBase() {
CreateContext(policy, base::Time::Now(), base::TimeTicks::Now()); CreateContext(policy, base::Time::Now(), base::TimeTicks::Now());
} }
ReportingTestBase::~ReportingTestBase() {} ReportingTestBase::~ReportingTestBase() = default;
void ReportingTestBase::UsePolicy(const ReportingPolicy& new_policy) { void ReportingTestBase::UsePolicy(const ReportingPolicy& new_policy) {
CreateContext(new_policy, clock()->Now(), tick_clock()->NowTicks()); CreateContext(new_policy, clock()->Now(), tick_clock()->NowTicks());
......
...@@ -163,7 +163,7 @@ class ReportingUploaderImpl : public ReportingUploader, URLRequest::Delegate { ...@@ -163,7 +163,7 @@ class ReportingUploaderImpl : public ReportingUploader, URLRequest::Delegate {
// static // static
const char ReportingUploader::kUploadContentType[] = "application/report"; const char ReportingUploader::kUploadContentType[] = "application/report";
ReportingUploader::~ReportingUploader() {} ReportingUploader::~ReportingUploader() = default;
// static // static
std::unique_ptr<ReportingUploader> ReportingUploader::Create( std::unique_ptr<ReportingUploader> ReportingUploader::Create(
......
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