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

Unified Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.cc

Issue 1873263002: Convert //components/data_reduction_proxy from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address feedback Created 4 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
Index: components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.cc
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.cc
index 6ecdd888879411ae2707c95f3ff161ccad64eabf..e1e283da033232158b33ecb4bf472f3e60368d33 100644
--- a/components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.cc
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.cc
@@ -73,7 +73,7 @@ namespace data_reduction_proxy {
// static
void DataReductionProxyEventStore::AddConstants(
base::DictionaryValue* constants_dict) {
- scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
for (size_t i = 0;
i < arraysize(kDataReductionProxyBypassEventTypeTable); ++i) {
dict->SetInteger(kDataReductionProxyBypassEventTypeTable[i].name,
@@ -104,7 +104,7 @@ DataReductionProxyEventStore::~DataReductionProxyEventStore() {
base::Value* DataReductionProxyEventStore::GetSummaryValue() const {
DCHECK(thread_checker_.CalledOnValidThread());
- scoped_ptr<base::DictionaryValue> data_reduction_proxy_values(
+ std::unique_ptr<base::DictionaryValue> data_reduction_proxy_values(
new base::DictionaryValue());
data_reduction_proxy_values->SetBoolean("enabled", enabled_);
@@ -150,7 +150,8 @@ base::Value* DataReductionProxyEventStore::GetSummaryValue() const {
return data_reduction_proxy_values.release();
}
-void DataReductionProxyEventStore::AddEvent(scoped_ptr<base::Value> event) {
+void DataReductionProxyEventStore::AddEvent(
+ std::unique_ptr<base::Value> event) {
if (stored_events_.size() == kMaxEventsToStore) {
base::Value* head = stored_events_.front();
stored_events_.pop_front();
@@ -161,7 +162,7 @@ void DataReductionProxyEventStore::AddEvent(scoped_ptr<base::Value> event) {
}
void DataReductionProxyEventStore::AddEnabledEvent(
- scoped_ptr<base::Value> event,
+ std::unique_ptr<base::Value> event,
bool enabled) {
DCHECK(thread_checker_.CalledOnValidThread());
enabled_ = enabled;
@@ -173,7 +174,7 @@ void DataReductionProxyEventStore::AddEnabledEvent(
}
void DataReductionProxyEventStore::AddEventAndSecureProxyCheckState(
- scoped_ptr<base::Value> event,
+ std::unique_ptr<base::Value> event,
SecureProxyCheckState state) {
DCHECK(thread_checker_.CalledOnValidThread());
secure_proxy_check_state_ = state;
@@ -181,7 +182,7 @@ void DataReductionProxyEventStore::AddEventAndSecureProxyCheckState(
}
void DataReductionProxyEventStore::AddAndSetLastBypassEvent(
- scoped_ptr<base::Value> event,
+ std::unique_ptr<base::Value> event,
int64_t expiration_ticks) {
DCHECK(thread_checker_.CalledOnValidThread());
last_bypass_event_.reset(event->DeepCopy());
@@ -243,7 +244,8 @@ std::string DataReductionProxyEventStore::SanitizedLastBypassEvent() const {
return std::string();
// Explicitly add parameters to prevent automatic adding of new parameters.
- scoped_ptr<base::DictionaryValue> last_bypass(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> last_bypass(
+ new base::DictionaryValue());
std::string str_value;
int int_value;

Powered by Google App Engine
This is Rietveld 408576698