Chromium Code Reviews| Index: components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.cc |
| diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.cc |
| index f7d418b21fa4e88593875ac18f6c95859ac86143..bb00dd2c9622ba0fc0e4fb881e10810bc0a700cf 100644 |
| --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.cc |
| +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.cc |
| @@ -16,7 +16,7 @@ namespace data_reduction_proxy { |
| namespace { |
| -scoped_ptr<base::Value> BuildDataReductionProxyEvent( |
| +std::unique_ptr<base::Value> BuildDataReductionProxyEvent( |
|
megjablon
2016/04/12 21:55:36
#include <memory> ?
dcheng
2016/04/12 22:38:34
Done.
|
| net::NetLog::EventType type, |
| const net::NetLog::Source& source, |
| net::NetLog::EventPhase phase, |
| @@ -26,7 +26,7 @@ scoped_ptr<base::Value> BuildDataReductionProxyEvent( |
| ¶meters_callback); |
| net::NetLog::Entry entry(&entry_data, |
| net::NetLogCaptureMode::IncludeSocketBytes()); |
| - scoped_ptr<base::Value> entry_value(entry.ToValue()); |
| + std::unique_ptr<base::Value> entry_value(entry.ToValue()); |
| return entry_value; |
| } |
| @@ -39,19 +39,19 @@ int64_t GetExpirationTicks(int bypass_seconds) { |
| // A callback which creates a base::Value containing information about enabling |
| // the Data Reduction Proxy. |
| -scoped_ptr<base::Value> EnableDataReductionProxyCallback( |
| +std::unique_ptr<base::Value> EnableDataReductionProxyCallback( |
| bool secure_transport_restricted, |
| const std::vector<net::ProxyServer>& proxies_for_http, |
| const std::vector<net::ProxyServer>& proxies_for_https, |
| net::NetLogCaptureMode /* capture_mode */) { |
| - scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| dict->SetBoolean("enabled", true); |
| dict->SetBoolean("secure_transport_restricted", secure_transport_restricted); |
| - scoped_ptr<base::ListValue> http_proxy_list(new base::ListValue()); |
| + std::unique_ptr<base::ListValue> http_proxy_list(new base::ListValue()); |
| for (const auto& proxy : proxies_for_http) |
| http_proxy_list->AppendString(proxy.ToURI()); |
| - scoped_ptr<base::ListValue> https_proxy_list(new base::ListValue()); |
| + std::unique_ptr<base::ListValue> https_proxy_list(new base::ListValue()); |
| for (const auto& proxy : proxies_for_https) |
| https_proxy_list->AppendString(proxy.ToURI()); |
| @@ -63,16 +63,16 @@ scoped_ptr<base::Value> EnableDataReductionProxyCallback( |
| // A callback which creates a base::Value containing information about disabling |
| // the Data Reduction Proxy. |
| -scoped_ptr<base::Value> DisableDataReductionProxyCallback( |
| +std::unique_ptr<base::Value> DisableDataReductionProxyCallback( |
| net::NetLogCaptureMode /* capture_mode */) { |
| - scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| dict->SetBoolean("enabled", false); |
| return std::move(dict); |
| } |
| // A callback which creates a base::Value containing information about bypassing |
| // the Data Reduction Proxy. |
| -scoped_ptr<base::Value> UrlBypassActionCallback( |
| +std::unique_ptr<base::Value> UrlBypassActionCallback( |
| DataReductionProxyBypassAction action, |
| const std::string& request_method, |
| const GURL& url, |
| @@ -80,7 +80,7 @@ scoped_ptr<base::Value> UrlBypassActionCallback( |
| int bypass_seconds, |
| int64_t expiration_ticks, |
| net::NetLogCaptureMode /* capture_mode */) { |
| - scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| dict->SetInteger("bypass_action_type", action); |
| dict->SetString("method", request_method); |
| dict->SetString("url", url.spec()); |
| @@ -93,7 +93,7 @@ scoped_ptr<base::Value> UrlBypassActionCallback( |
| // A callback which creates a base::Value containing information about bypassing |
| // the Data Reduction Proxy. |
| -scoped_ptr<base::Value> UrlBypassTypeCallback( |
| +std::unique_ptr<base::Value> UrlBypassTypeCallback( |
| DataReductionProxyBypassType bypass_type, |
| const std::string& request_method, |
| const GURL& url, |
| @@ -101,7 +101,7 @@ scoped_ptr<base::Value> UrlBypassTypeCallback( |
| int bypass_seconds, |
| int64_t expiration_ticks, |
| net::NetLogCaptureMode /* capture_mode */) { |
| - scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| dict->SetInteger("bypass_type", bypass_type); |
| dict->SetString("method", request_method); |
| dict->SetString("url", url.spec()); |
| @@ -114,11 +114,11 @@ scoped_ptr<base::Value> UrlBypassTypeCallback( |
| // A callback that creates a base::Value containing information about a proxy |
| // fallback event for a Data Reduction Proxy. |
| -scoped_ptr<base::Value> FallbackCallback( |
| +std::unique_ptr<base::Value> FallbackCallback( |
| const std::string& proxy_url, |
| int net_error, |
| net::NetLogCaptureMode /* capture_mode */) { |
| - scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| dict->SetString("proxy", proxy_url); |
| dict->SetInteger("net_error", net_error); |
| return std::move(dict); |
| @@ -126,12 +126,12 @@ scoped_ptr<base::Value> FallbackCallback( |
| // A callback which creates a base::Value containing information about |
| // completing the Data Reduction Proxy secure proxy check. |
| -scoped_ptr<base::Value> EndCanaryRequestCallback( |
| +std::unique_ptr<base::Value> EndCanaryRequestCallback( |
| int net_error, |
| int http_response_code, |
| bool succeeded, |
| net::NetLogCaptureMode /* capture_mode */) { |
| - scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| dict->SetInteger("net_error", net_error); |
| dict->SetInteger("http_response_code", http_response_code); |
| dict->SetBoolean("check_succeeded", succeeded); |
| @@ -140,7 +140,7 @@ scoped_ptr<base::Value> EndCanaryRequestCallback( |
| // A callback that creates a base::Value containing information about |
| // completing the Data Reduction Proxy configuration request. |
| -scoped_ptr<base::Value> EndConfigRequestCallback( |
| +std::unique_ptr<base::Value> EndConfigRequestCallback( |
| int net_error, |
| int http_response_code, |
| int failure_count, |
| @@ -148,10 +148,10 @@ scoped_ptr<base::Value> EndConfigRequestCallback( |
| int64_t refresh_duration_minutes, |
| int64_t expiration_ticks, |
| net::NetLogCaptureMode /* capture_mode */) { |
| - scoped_ptr<base::ListValue> http_proxy_list(new base::ListValue()); |
| + std::unique_ptr<base::ListValue> http_proxy_list(new base::ListValue()); |
| for (const auto& proxy : proxies_for_http) |
| http_proxy_list->AppendString(proxy.ToURI()); |
| - scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| dict->SetInteger("net_error", net_error); |
| dict->SetInteger("http_response_code", http_response_code); |
| dict->SetInteger("failure_count", failure_count); |
| @@ -305,7 +305,7 @@ void DataReductionProxyEventCreator::PostEvent( |
| net::NetLog* net_log, |
| net::NetLog::EventType type, |
| const net::NetLog::ParametersCallback& callback) { |
| - scoped_ptr<base::Value> event = BuildDataReductionProxyEvent( |
| + std::unique_ptr<base::Value> event = BuildDataReductionProxyEvent( |
| type, net::NetLog::Source(), net::NetLog::PHASE_NONE, callback); |
| if (event) |
| storage_delegate_->AddEvent(std::move(event)); |
| @@ -319,7 +319,7 @@ void DataReductionProxyEventCreator::PostEnabledEvent( |
| net::NetLog::EventType type, |
| bool enabled, |
| const net::NetLog::ParametersCallback& callback) { |
| - scoped_ptr<base::Value> event = BuildDataReductionProxyEvent( |
| + std::unique_ptr<base::Value> event = BuildDataReductionProxyEvent( |
| type, net::NetLog::Source(), net::NetLog::PHASE_NONE, callback); |
| if (event) |
| storage_delegate_->AddEnabledEvent(std::move(event), enabled); |
| @@ -334,7 +334,7 @@ void DataReductionProxyEventCreator::PostBoundNetLogBypassEvent( |
| net::NetLog::EventPhase phase, |
| int64_t expiration_ticks, |
| const net::NetLog::ParametersCallback& callback) { |
| - scoped_ptr<base::Value> event = |
| + std::unique_ptr<base::Value> event = |
| BuildDataReductionProxyEvent(type, net_log.source(), phase, callback); |
| if (event) |
| storage_delegate_->AddAndSetLastBypassEvent(std::move(event), |
| @@ -348,7 +348,7 @@ void DataReductionProxyEventCreator::PostBoundNetLogSecureProxyCheckEvent( |
| net::NetLog::EventPhase phase, |
| DataReductionProxyEventStorageDelegate::SecureProxyCheckState state, |
| const net::NetLog::ParametersCallback& callback) { |
| - scoped_ptr<base::Value> event( |
| + std::unique_ptr<base::Value> event( |
| BuildDataReductionProxyEvent(type, net_log.source(), phase, callback)); |
| if (event) |
| storage_delegate_->AddEventAndSecureProxyCheckState(std::move(event), |
| @@ -361,7 +361,7 @@ void DataReductionProxyEventCreator::PostBoundNetLogConfigRequestEvent( |
| net::NetLog::EventType type, |
| net::NetLog::EventPhase phase, |
| const net::NetLog::ParametersCallback& callback) { |
| - scoped_ptr<base::Value> event( |
| + std::unique_ptr<base::Value> event( |
| BuildDataReductionProxyEvent(type, net_log.source(), phase, callback)); |
| if (event) { |
| storage_delegate_->AddEvent(std::move(event)); |