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(
return std::make_unique<ReportingCacheImpl>(context);
}
ReportingCache::~ReportingCache() {}
ReportingCache::~ReportingCache() = default;
} // namespace net
......@@ -23,6 +23,6 @@ ReportingClient::ReportingClient(const url::Origin& origin,
group(group),
expires(expires) {}
ReportingClient::~ReportingClient() {}
ReportingClient::~ReportingClient() = default;
} // namespace net
......@@ -50,7 +50,7 @@ std::unique_ptr<ReportingContext> ReportingContext::Create(
return std::make_unique<ReportingContextImpl>(policy, request_context);
}
ReportingContext::~ReportingContext() {}
ReportingContext::~ReportingContext() = default;
void ReportingContext::AddObserver(ReportingObserver* observer) {
DCHECK(!observers_.HasObserver(observer));
......
......@@ -18,7 +18,7 @@ class ReportingDelegateImpl : public ReportingDelegate {
DCHECK(request_context);
}
~ReportingDelegateImpl() override {}
~ReportingDelegateImpl() override = default;
bool CanQueueReport(const url::Origin& origin) const override {
return network_delegate() &&
......@@ -58,6 +58,6 @@ std::unique_ptr<ReportingDelegate> ReportingDelegate::Create(
return std::make_unique<ReportingDelegateImpl>(request_context);
}
ReportingDelegate::~ReportingDelegate() {}
ReportingDelegate::~ReportingDelegate() = default;
} // namespace net
......@@ -81,7 +81,7 @@ class ReportingDeliveryAgentImpl : public ReportingDeliveryAgent,
const std::vector<const ReportingReport*>& reports)
: endpoint(endpoint), reports(reports) {}
~Delivery() {}
~Delivery() = default;
const GURL endpoint;
const std::vector<const ReportingReport*> reports;
......@@ -219,6 +219,6 @@ std::unique_ptr<ReportingDeliveryAgent> ReportingDeliveryAgent::Create(
return std::make_unique<ReportingDeliveryAgentImpl>(context);
}
ReportingDeliveryAgent::~ReportingDeliveryAgent() {}
ReportingDeliveryAgent::~ReportingDeliveryAgent() = default;
} // namespace net
......@@ -30,7 +30,7 @@ class ReportingEndpointManagerImpl : public ReportingEndpointManager {
public:
ReportingEndpointManagerImpl(ReportingContext* context) : context_(context) {}
~ReportingEndpointManagerImpl() override {}
~ReportingEndpointManagerImpl() override = default;
bool FindEndpointForOriginAndGroup(const url::Origin& origin,
const std::string& group,
......@@ -109,6 +109,6 @@ std::unique_ptr<ReportingEndpointManager> ReportingEndpointManager::Create(
return std::make_unique<ReportingEndpointManagerImpl>(context);
}
ReportingEndpointManager::~ReportingEndpointManager() {}
ReportingEndpointManager::~ReportingEndpointManager() = default;
} // namespace net
......@@ -86,6 +86,6 @@ std::unique_ptr<ReportingGarbageCollector> ReportingGarbageCollector::Create(
return std::make_unique<ReportingGarbageCollectorImpl>(context);
}
ReportingGarbageCollector::~ReportingGarbageCollector() {}
ReportingGarbageCollector::~ReportingGarbageCollector() = default;
} // namespace net
......@@ -60,6 +60,6 @@ ReportingNetworkChangeObserver::Create(ReportingContext* context) {
return std::make_unique<ReportingNetworkChangeObserverImpl>(context);
}
ReportingNetworkChangeObserver::~ReportingNetworkChangeObserver() {}
ReportingNetworkChangeObserver::~ReportingNetworkChangeObserver() = default;
} // namespace net
......@@ -8,8 +8,8 @@ namespace net {
void ReportingObserver::OnCacheUpdated() {}
ReportingObserver::ReportingObserver() {}
ReportingObserver::ReportingObserver() = default;
ReportingObserver::~ReportingObserver() {}
ReportingObserver::~ReportingObserver() = default;
} // namespace net
......@@ -66,7 +66,7 @@ class ReportingPersisterImpl : public ReportingPersister {
// ReportingPersister implementation:
~ReportingPersisterImpl() override {}
~ReportingPersisterImpl() override = default;
private:
std::string SerializeTicks(base::TimeTicks time_ticks) {
......@@ -316,6 +316,6 @@ std::unique_ptr<ReportingPersister> ReportingPersister::Create(
return std::make_unique<ReportingPersisterImpl>(context);
}
ReportingPersister::~ReportingPersister() {}
ReportingPersister::~ReportingPersister() = default;
} // namespace net
......@@ -29,21 +29,8 @@ ReportingPolicy::ReportingPolicy()
endpoint_backoff_policy.always_use_initial_delay = false;
}
ReportingPolicy::ReportingPolicy(const ReportingPolicy& other)
: 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(const ReportingPolicy& other) = default;
ReportingPolicy::~ReportingPolicy() {}
ReportingPolicy::~ReportingPolicy() = default;
} // namespace net
......@@ -28,7 +28,7 @@ class ReportingServiceImpl : public ReportingService {
ReportingServiceImpl(std::unique_ptr<ReportingContext> context)
: context_(std::move(context)) {}
~ReportingServiceImpl() override {}
~ReportingServiceImpl() override = default;
void QueueReport(const GURL& url,
const std::string& group,
......@@ -61,7 +61,7 @@ class ReportingServiceImpl : public ReportingService {
} // namespace
ReportingService::~ReportingService() {}
ReportingService::~ReportingService() = default;
// static
std::unique_ptr<ReportingService> ReportingService::Create(
......
......@@ -43,7 +43,7 @@ class PendingUploadImpl : public TestReportingUploader::PendingUpload {
callback_(callback),
complete_callback_(complete_callback) {}
~PendingUploadImpl() override {}
~PendingUploadImpl() override = default;
// PendingUpload implementationP:
const GURL& url() const override { return url_; }
......@@ -91,11 +91,11 @@ const ReportingClient* FindClientInCache(const ReportingCache* cache,
return nullptr;
}
TestReportingUploader::PendingUpload::~PendingUpload() {}
TestReportingUploader::PendingUpload::PendingUpload() {}
TestReportingUploader::PendingUpload::~PendingUpload() = default;
TestReportingUploader::PendingUpload::PendingUpload() = default;
TestReportingUploader::TestReportingUploader() {}
TestReportingUploader::~TestReportingUploader() {}
TestReportingUploader::TestReportingUploader() = default;
TestReportingUploader::~TestReportingUploader() = default;
void TestReportingUploader::StartUpload(const GURL& url,
const std::string& json,
......@@ -104,9 +104,9 @@ void TestReportingUploader::StartUpload(const GURL& url,
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 {
return true;
......@@ -155,7 +155,7 @@ ReportingTestBase::ReportingTestBase() {
CreateContext(policy, base::Time::Now(), base::TimeTicks::Now());
}
ReportingTestBase::~ReportingTestBase() {}
ReportingTestBase::~ReportingTestBase() = default;
void ReportingTestBase::UsePolicy(const ReportingPolicy& new_policy) {
CreateContext(new_policy, clock()->Now(), tick_clock()->NowTicks());
......
......@@ -163,7 +163,7 @@ class ReportingUploaderImpl : public ReportingUploader, URLRequest::Delegate {
// static
const char ReportingUploader::kUploadContentType[] = "application/report";
ReportingUploader::~ReportingUploader() {}
ReportingUploader::~ReportingUploader() = default;
// static
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