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

Unified Diff: net/ssl/default_channel_id_store.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu 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
« no previous file with comments | « net/ssl/default_channel_id_store.h ('k') | net/ssl/default_channel_id_store_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/default_channel_id_store.cc
diff --git a/net/ssl/default_channel_id_store.cc b/net/ssl/default_channel_id_store.cc
index 184fccd305557798957a5b4c53fab4848c3f4726..8287077286fe8a475972e7c7cce73cc4b8f0f191 100644
--- a/net/ssl/default_channel_id_store.cc
+++ b/net/ssl/default_channel_id_store.cc
@@ -64,7 +64,7 @@ DefaultChannelIDStore::GetChannelIDTask::~GetChannelIDTask() {
void DefaultChannelIDStore::GetChannelIDTask::Run(
DefaultChannelIDStore* store) {
- scoped_ptr<crypto::ECPrivateKey> key_result;
+ std::unique_ptr<crypto::ECPrivateKey> key_result;
int err = store->GetChannelID(server_identifier_, &key_result,
GetChannelIDCallback());
DCHECK(err != ERR_IO_PENDING);
@@ -78,16 +78,16 @@ void DefaultChannelIDStore::GetChannelIDTask::Run(
class DefaultChannelIDStore::SetChannelIDTask
: public DefaultChannelIDStore::Task {
public:
- SetChannelIDTask(scoped_ptr<ChannelID> channel_id);
+ SetChannelIDTask(std::unique_ptr<ChannelID> channel_id);
~SetChannelIDTask() override;
void Run(DefaultChannelIDStore* store) override;
private:
- scoped_ptr<ChannelID> channel_id_;
+ std::unique_ptr<ChannelID> channel_id_;
};
DefaultChannelIDStore::SetChannelIDTask::SetChannelIDTask(
- scoped_ptr<ChannelID> channel_id)
+ std::unique_ptr<ChannelID> channel_id)
: channel_id_(std::move(channel_id)) {}
DefaultChannelIDStore::SetChannelIDTask::~SetChannelIDTask() {
@@ -213,13 +213,13 @@ DefaultChannelIDStore::DefaultChannelIDStore(
int DefaultChannelIDStore::GetChannelID(
const std::string& server_identifier,
- scoped_ptr<crypto::ECPrivateKey>* key_result,
+ std::unique_ptr<crypto::ECPrivateKey>* key_result,
const GetChannelIDCallback& callback) {
DCHECK(CalledOnValidThread());
InitIfNecessary();
if (!loaded_) {
- EnqueueTask(scoped_ptr<Task>(
+ EnqueueTask(std::unique_ptr<Task>(
new GetChannelIDTask(server_identifier, callback)));
return ERR_IO_PENDING;
}
@@ -235,15 +235,16 @@ int DefaultChannelIDStore::GetChannelID(
return OK;
}
-void DefaultChannelIDStore::SetChannelID(scoped_ptr<ChannelID> channel_id) {
+void DefaultChannelIDStore::SetChannelID(
+ std::unique_ptr<ChannelID> channel_id) {
auto task = new SetChannelIDTask(std::move(channel_id));
- RunOrEnqueueTask(scoped_ptr<Task>(task));
+ RunOrEnqueueTask(std::unique_ptr<Task>(task));
}
void DefaultChannelIDStore::DeleteChannelID(
const std::string& server_identifier,
const base::Closure& callback) {
- RunOrEnqueueTask(scoped_ptr<Task>(
+ RunOrEnqueueTask(std::unique_ptr<Task>(
new DeleteChannelIDTask(server_identifier, callback)));
}
@@ -251,7 +252,7 @@ void DefaultChannelIDStore::DeleteAllCreatedBetween(
base::Time delete_begin,
base::Time delete_end,
const base::Closure& callback) {
- RunOrEnqueueTask(scoped_ptr<Task>(
+ RunOrEnqueueTask(std::unique_ptr<Task>(
new DeleteAllCreatedBetweenTask(delete_begin, delete_end, callback)));
}
@@ -262,7 +263,7 @@ void DefaultChannelIDStore::DeleteAll(
void DefaultChannelIDStore::GetAllChannelIDs(
const GetChannelIDListCallback& callback) {
- RunOrEnqueueTask(scoped_ptr<Task>(new GetAllChannelIDsTask(callback)));
+ RunOrEnqueueTask(std::unique_ptr<Task>(new GetAllChannelIDsTask(callback)));
}
int DefaultChannelIDStore::GetChannelIDCount() {
@@ -303,9 +304,10 @@ void DefaultChannelIDStore::InitStore() {
}
void DefaultChannelIDStore::OnLoaded(
- scoped_ptr<std::vector<scoped_ptr<ChannelID>>> channel_ids) {
+ std::unique_ptr<std::vector<std::unique_ptr<ChannelID>>> channel_ids) {
DCHECK(CalledOnValidThread());
- for (std::vector<scoped_ptr<ChannelID>>::iterator it = channel_ids->begin();
+ for (std::vector<std::unique_ptr<ChannelID>>::iterator it =
+ channel_ids->begin();
it != channel_ids->end(); ++it) {
DCHECK(channel_ids_.find((*it)->server_identifier()) ==
channel_ids_.end());
@@ -328,12 +330,13 @@ void DefaultChannelIDStore::OnLoaded(
UMA_HISTOGRAM_COUNTS_100("DomainBoundCerts.TaskWaitCount",
waiting_tasks_.size());
- for (scoped_ptr<Task>& i : waiting_tasks_)
+ for (std::unique_ptr<Task>& i : waiting_tasks_)
i->Run(this);
waiting_tasks_.clear();
}
-void DefaultChannelIDStore::SyncSetChannelID(scoped_ptr<ChannelID> channel_id) {
+void DefaultChannelIDStore::SyncSetChannelID(
+ std::unique_ptr<ChannelID> channel_id) {
DCHECK(CalledOnValidThread());
DCHECK(loaded_);
@@ -378,7 +381,7 @@ void DefaultChannelIDStore::SyncGetAllChannelIDs(
channel_id_list->push_back(*it->second);
}
-void DefaultChannelIDStore::EnqueueTask(scoped_ptr<Task> task) {
+void DefaultChannelIDStore::EnqueueTask(std::unique_ptr<Task> task) {
DCHECK(CalledOnValidThread());
DCHECK(!loaded_);
if (waiting_tasks_.empty())
@@ -386,7 +389,7 @@ void DefaultChannelIDStore::EnqueueTask(scoped_ptr<Task> task) {
waiting_tasks_.push_back(std::move(task));
}
-void DefaultChannelIDStore::RunOrEnqueueTask(scoped_ptr<Task> task) {
+void DefaultChannelIDStore::RunOrEnqueueTask(std::unique_ptr<Task> task) {
DCHECK(CalledOnValidThread());
InitIfNecessary();
@@ -415,7 +418,7 @@ void DefaultChannelIDStore::InternalDeleteChannelID(
}
void DefaultChannelIDStore::InternalInsertChannelID(
- scoped_ptr<ChannelID> channel_id) {
+ std::unique_ptr<ChannelID> channel_id) {
DCHECK(CalledOnValidThread());
DCHECK(loaded_);
« no previous file with comments | « net/ssl/default_channel_id_store.h ('k') | net/ssl/default_channel_id_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698