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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.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/browser/data_reduction_proxy_io_data.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
index c4f13fbfcc0e8ce554ac6005bf9bfb64a31002ce..b57de90df0e8199566a74fefa0d340ea3bde8fc1 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.h"
@@ -54,8 +55,8 @@ class BasicHTTPURLRequestContextGetter : public net::URLRequestContextGetter {
~BasicHTTPURLRequestContextGetter() override;
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
- scoped_ptr<net::HttpUserAgentSettings> user_agent_settings_;
- scoped_ptr<net::URLRequestContext> url_request_context_;
+ std::unique_ptr<net::HttpUserAgentSettings> user_agent_settings_;
+ std::unique_ptr<net::URLRequestContext> url_request_context_;
DISALLOW_COPY_AND_ASSIGN(BasicHTTPURLRequestContextGetter);
};
@@ -109,7 +110,7 @@ DataReductionProxyIOData::DataReductionProxyIOData(
DCHECK(net_log);
DCHECK(io_task_runner_);
DCHECK(ui_task_runner_);
- scoped_ptr<DataReductionProxyParams> params(
+ std::unique_ptr<DataReductionProxyParams> params(
new DataReductionProxyParams(param_flags));
params->EnableQuic(enable_quic);
event_creator_.reset(new DataReductionProxyEventCreator(this));
@@ -119,7 +120,7 @@ DataReductionProxyIOData::DataReductionProxyIOData(
params::IsConfigClientEnabled() && client_ != CRONET_ANDROID;
DataReductionProxyMutableConfigValues* raw_mutable_config = nullptr;
if (use_config_client) {
- scoped_ptr<DataReductionProxyMutableConfigValues> mutable_config =
+ std::unique_ptr<DataReductionProxyMutableConfigValues> mutable_config =
DataReductionProxyMutableConfigValues::CreateFromParams(params.get());
raw_mutable_config = mutable_config.get();
config_.reset(new DataReductionProxyConfig(
@@ -207,20 +208,20 @@ bool DataReductionProxyIOData::IsEnabled() const {
return enabled_;
}
-scoped_ptr<net::URLRequestInterceptor>
+std::unique_ptr<net::URLRequestInterceptor>
DataReductionProxyIOData::CreateInterceptor() {
DCHECK(io_task_runner_->BelongsToCurrentThread());
- return make_scoped_ptr(new DataReductionProxyInterceptor(
+ return base::WrapUnique(new DataReductionProxyInterceptor(
config_.get(), config_client_.get(), bypass_stats_.get(),
event_creator_.get()));
}
-scoped_ptr<DataReductionProxyNetworkDelegate>
+std::unique_ptr<DataReductionProxyNetworkDelegate>
DataReductionProxyIOData::CreateNetworkDelegate(
- scoped_ptr<net::NetworkDelegate> wrapped_network_delegate,
+ std::unique_ptr<net::NetworkDelegate> wrapped_network_delegate,
bool track_proxy_bypass_statistics) {
DCHECK(io_task_runner_->BelongsToCurrentThread());
- scoped_ptr<DataReductionProxyNetworkDelegate> network_delegate(
+ std::unique_ptr<DataReductionProxyNetworkDelegate> network_delegate(
new DataReductionProxyNetworkDelegate(
std::move(wrapped_network_delegate), config_.get(),
request_options_.get(), configurator_.get()));
@@ -229,10 +230,10 @@ DataReductionProxyIOData::CreateNetworkDelegate(
return network_delegate;
}
-scoped_ptr<DataReductionProxyDelegate>
+std::unique_ptr<DataReductionProxyDelegate>
DataReductionProxyIOData::CreateProxyDelegate() const {
DCHECK(io_task_runner_->BelongsToCurrentThread());
- return make_scoped_ptr(new DataReductionProxyDelegate(
+ return base::WrapUnique(new DataReductionProxyDelegate(
request_options_.get(), config_.get(), configurator_.get(),
event_creator_.get(), bypass_stats_.get(), net_log_));
}
@@ -305,15 +306,16 @@ void DataReductionProxyIOData::SetLoFiModeActiveOnMainFrame(
service_, lo_fi_mode_active));
}
-void DataReductionProxyIOData::AddEvent(scoped_ptr<base::Value> event) {
+void DataReductionProxyIOData::AddEvent(std::unique_ptr<base::Value> event) {
DCHECK(io_task_runner_->BelongsToCurrentThread());
ui_task_runner_->PostTask(
FROM_HERE, base::Bind(&DataReductionProxyService::AddEvent, service_,
base::Passed(&event)));
}
-void DataReductionProxyIOData::AddEnabledEvent(scoped_ptr<base::Value> event,
- bool enabled) {
+void DataReductionProxyIOData::AddEnabledEvent(
+ std::unique_ptr<base::Value> event,
+ bool enabled) {
DCHECK(io_task_runner_->BelongsToCurrentThread());
ui_task_runner_->PostTask(
FROM_HERE, base::Bind(&DataReductionProxyService::AddEnabledEvent,
@@ -321,7 +323,7 @@ void DataReductionProxyIOData::AddEnabledEvent(scoped_ptr<base::Value> event,
}
void DataReductionProxyIOData::AddEventAndSecureProxyCheckState(
- scoped_ptr<base::Value> event,
+ std::unique_ptr<base::Value> event,
SecureProxyCheckState state) {
DCHECK(io_task_runner_->BelongsToCurrentThread());
ui_task_runner_->PostTask(
@@ -331,7 +333,7 @@ void DataReductionProxyIOData::AddEventAndSecureProxyCheckState(
}
void DataReductionProxyIOData::AddAndSetLastBypassEvent(
- scoped_ptr<base::Value> event,
+ std::unique_ptr<base::Value> event,
int64_t expiration_ticks) {
DCHECK(io_task_runner_->BelongsToCurrentThread());
ui_task_runner_->PostTask(

Powered by Google App Engine
This is Rietveld 408576698