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

Unified Diff: chromecast/base/device_capabilities_impl.cc

Issue 1553503002: Convert Pass()→std::move() in //chromecast (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | chromecast/base/device_capabilities_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/base/device_capabilities_impl.cc
diff --git a/chromecast/base/device_capabilities_impl.cc b/chromecast/base/device_capabilities_impl.cc
index bd0fd1337266157d05f2e8c05214b19edc06bc09..22b8efa5e93e7ae61bcc766d5927d759b98a8632 100644
--- a/chromecast/base/device_capabilities_impl.cc
+++ b/chromecast/base/device_capabilities_impl.cc
@@ -5,6 +5,7 @@
#include "chromecast/base/device_capabilities_impl.h"
#include <stddef.h>
+#include <utility>
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
@@ -70,7 +71,7 @@ scoped_refptr<DeviceCapabilities::Data> DeviceCapabilities::CreateData() {
scoped_refptr<DeviceCapabilities::Data> DeviceCapabilities::CreateData(
scoped_ptr<const base::DictionaryValue> dictionary) {
DCHECK(dictionary.get());
- return make_scoped_refptr(new Data(dictionary.Pass()));
+ return make_scoped_refptr(new Data(std::move(dictionary)));
}
DeviceCapabilities::Validator::Validator(DeviceCapabilities* capabilities)
@@ -81,7 +82,7 @@ DeviceCapabilities::Validator::Validator(DeviceCapabilities* capabilities)
void DeviceCapabilities::Validator::SetValidatedValue(
const std::string& path,
scoped_ptr<base::Value> new_value) const {
- capabilities_->SetValidatedValue(path, new_value.Pass());
+ capabilities_->SetValidatedValue(path, std::move(new_value));
}
DeviceCapabilities::Data::Data()
@@ -92,7 +93,7 @@ DeviceCapabilities::Data::Data()
DeviceCapabilities::Data::Data(
scoped_ptr<const base::DictionaryValue> dictionary)
- : dictionary_(dictionary.Pass()),
+ : dictionary_(std::move(dictionary)),
json_string_(SerializeToJson(*dictionary_)) {
DCHECK(dictionary_.get());
DCHECK(json_string_.get());
@@ -118,7 +119,7 @@ void DeviceCapabilitiesImpl::ValidatorInfo::Validate(
// Check that we are running Validate on the same thread that ValidatorInfo
// was constructed on.
DCHECK(task_runner_->BelongsToCurrentThread());
- validator_->Validate(path, proposed_value.Pass());
+ validator_->Validate(path, std::move(proposed_value));
}
DeviceCapabilitiesImpl::DeviceCapabilitiesImpl()
@@ -238,7 +239,7 @@ void DeviceCapabilitiesImpl::SetCapability(
}
// Since we are done checking for a registered Validator at this point, we
// can release the lock. All further member access will be for capabilities.
- SetValidatedValue(path, proposed_value.Pass());
+ SetValidatedValue(path, std::move(proposed_value));
}
void DeviceCapabilitiesImpl::MergeDictionary(
@@ -292,8 +293,8 @@ void DeviceCapabilitiesImpl::SetValidatedValue(
// threads.
scoped_ptr<base::DictionaryValue> dictionary_deep_copy(
data_->dictionary().CreateDeepCopy());
- dictionary_deep_copy->Set(path, new_value.Pass());
- scoped_refptr<Data> new_data(CreateData(dictionary_deep_copy.Pass()));
+ dictionary_deep_copy->Set(path, std::move(new_value));
+ scoped_refptr<Data> new_data(CreateData(std::move(dictionary_deep_copy)));
{
base::AutoLock auto_lock(data_lock_);
« no previous file with comments | « no previous file | chromecast/base/device_capabilities_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698