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

Unified Diff: remoting/protocol/pairing_registry.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac 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 | « remoting/protocol/pairing_registry.h ('k') | remoting/protocol/pairing_registry_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/pairing_registry.cc
diff --git a/remoting/protocol/pairing_registry.cc b/remoting/protocol/pairing_registry.cc
index f6ba2d5c225621e84423768c11aeb1aff361c62b..54cf78acef85d9980bdd0fae9a6f62374b415793 100644
--- a/remoting/protocol/pairing_registry.cc
+++ b/remoting/protocol/pairing_registry.cc
@@ -79,8 +79,9 @@ PairingRegistry::Pairing PairingRegistry::Pairing::CreateFromValue(
return Pairing();
}
-scoped_ptr<base::DictionaryValue> PairingRegistry::Pairing::ToValue() const {
- scoped_ptr<base::DictionaryValue> pairing(new base::DictionaryValue());
+std::unique_ptr<base::DictionaryValue> PairingRegistry::Pairing::ToValue()
+ const {
+ std::unique_ptr<base::DictionaryValue> pairing(new base::DictionaryValue());
pairing->SetDouble(kCreatedTimeKey, created_time().ToJsTime());
pairing->SetString(kClientNameKey, client_name());
pairing->SetString(kClientIdKey, client_id());
@@ -104,7 +105,7 @@ bool PairingRegistry::Pairing::is_valid() const {
PairingRegistry::PairingRegistry(
scoped_refptr<base::SingleThreadTaskRunner> delegate_task_runner,
- scoped_ptr<Delegate> delegate)
+ std::unique_ptr<Delegate> delegate)
: caller_task_runner_(base::ThreadTaskRunnerHandle::Get()),
delegate_task_runner_(delegate_task_runner),
delegate_(std::move(delegate)) {
@@ -194,7 +195,7 @@ void PairingRegistry::DoLoadAll(
const protocol::PairingRegistry::GetAllPairingsCallback& callback) {
DCHECK(delegate_task_runner_->BelongsToCurrentThread());
- scoped_ptr<base::ListValue> pairings = delegate_->LoadAll();
+ std::unique_ptr<base::ListValue> pairings = delegate_->LoadAll();
PostTask(caller_task_runner_, FROM_HERE, base::Bind(callback,
base::Passed(&pairings)));
}
@@ -253,17 +254,18 @@ void PairingRegistry::InvokeGetPairingCallbackAndScheduleNext(
void PairingRegistry::InvokeGetAllPairingsCallbackAndScheduleNext(
const GetAllPairingsCallback& callback,
- scoped_ptr<base::ListValue> pairings) {
+ std::unique_ptr<base::ListValue> pairings) {
callback.Run(std::move(pairings));
pending_requests_.pop();
ServiceNextRequest();
}
-void PairingRegistry::SanitizePairings(const GetAllPairingsCallback& callback,
- scoped_ptr<base::ListValue> pairings) {
+void PairingRegistry::SanitizePairings(
+ const GetAllPairingsCallback& callback,
+ std::unique_ptr<base::ListValue> pairings) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- scoped_ptr<base::ListValue> sanitized_pairings(new base::ListValue());
+ std::unique_ptr<base::ListValue> sanitized_pairings(new base::ListValue());
for (size_t i = 0; i < pairings->GetSize(); ++i) {
base::DictionaryValue* pairing_json;
if (!pairings->GetDictionary(i, &pairing_json)) {
« no previous file with comments | « remoting/protocol/pairing_registry.h ('k') | remoting/protocol/pairing_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698