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

Unified Diff: remoting/host/policy_watcher.cc

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
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
Index: remoting/host/policy_watcher.cc
diff --git a/remoting/host/policy_watcher.cc b/remoting/host/policy_watcher.cc
index 9f8bd01dfd7d548a60a746ee5b34aab6307cebf1..a4842ef93b872af735b606c0e8cd44ee9847d9b5 100644
--- a/remoting/host/policy_watcher.cc
+++ b/remoting/host/policy_watcher.cc
@@ -62,7 +62,7 @@ scoped_ptr<base::DictionaryValue> CopyValuesAndAddDefaults(
to->Set(i.key(), value->DeepCopy());
}
- return to.Pass();
+ return to;
}
policy::PolicyNamespace GetPolicyNamespace() {
@@ -78,7 +78,7 @@ scoped_ptr<policy::SchemaRegistry> CreateSchemaRegistry() {
scoped_ptr<policy::SchemaRegistry> schema_registry(
new policy::SchemaRegistry());
schema_registry->RegisterComponent(GetPolicyNamespace(), schema);
- return schema_registry.Pass();
+ return schema_registry;
}
scoped_ptr<base::DictionaryValue> CopyChromotingPoliciesIntoDictionary(
@@ -98,7 +98,7 @@ scoped_ptr<base::DictionaryValue> CopyChromotingPoliciesIntoDictionary(
}
}
- return policy_dict.Pass();
+ return policy_dict;
}
// Takes a dictionary containing only 1) recognized policy names and 2)
@@ -166,9 +166,9 @@ PolicyWatcher::PolicyWatcher(
: old_policies_(new base::DictionaryValue()),
default_values_(new base::DictionaryValue()),
policy_service_(policy_service),
- owned_schema_registry_(owned_schema_registry.Pass()),
- owned_policy_provider_(owned_policy_provider.Pass()),
- owned_policy_service_(owned_policy_service.Pass()) {
+ owned_schema_registry_(std::move(owned_schema_registry)),
+ owned_policy_provider_(std::move(owned_policy_provider)),
+ owned_policy_service_(std::move(owned_policy_service)) {
DCHECK(policy_service_);
DCHECK(owned_schema_registry_);
@@ -274,7 +274,7 @@ PolicyWatcher::StoreNewAndReturnChangedPolicies(
// Save the new policies.
old_policies_.swap(new_policies);
- return changed_policies.Pass();
+ return changed_policies;
}
void PolicyWatcher::OnPolicyUpdated(const policy::PolicyNamespace& ns,
@@ -295,7 +295,7 @@ void PolicyWatcher::OnPolicyUpdated(const policy::PolicyNamespace& ns,
// Limit reporting to only the policies that were changed.
scoped_ptr<base::DictionaryValue> changed_policies =
- StoreNewAndReturnChangedPolicies(filled_policies.Pass());
+ StoreNewAndReturnChangedPolicies(std::move(filled_policies));
if (changed_policies->empty()) {
return;
}
@@ -307,7 +307,7 @@ void PolicyWatcher::OnPolicyUpdated(const policy::PolicyNamespace& ns,
}
// Notify our client of the changed policies.
- policy_updated_callback_.Run(changed_policies.Pass());
+ policy_updated_callback_.Run(std::move(changed_policies));
}
void PolicyWatcher::OnPolicyServiceInitialized(policy::PolicyDomain domain) {
@@ -321,7 +321,7 @@ scoped_ptr<PolicyWatcher> PolicyWatcher::CreateFromPolicyLoader(
scoped_ptr<policy::SchemaRegistry> schema_registry = CreateSchemaRegistry();
scoped_ptr<policy::AsyncPolicyProvider> policy_provider(
new policy::AsyncPolicyProvider(schema_registry.get(),
- async_policy_loader.Pass()));
+ std::move(async_policy_loader)));
policy_provider->Init(schema_registry.get());
policy::PolicyServiceImpl::Providers providers;
@@ -330,9 +330,9 @@ scoped_ptr<PolicyWatcher> PolicyWatcher::CreateFromPolicyLoader(
new policy::PolicyServiceImpl(providers));
policy::PolicyService* borrowed_policy_service = policy_service.get();
- return make_scoped_ptr(
- new PolicyWatcher(borrowed_policy_service, policy_service.Pass(),
- policy_provider.Pass(), schema_registry.Pass()));
+ return make_scoped_ptr(new PolicyWatcher(
+ borrowed_policy_service, std::move(policy_service),
+ std::move(policy_provider), std::move(schema_registry)));
}
scoped_ptr<PolicyWatcher> PolicyWatcher::Create(
@@ -369,7 +369,7 @@ scoped_ptr<PolicyWatcher> PolicyWatcher::Create(
#error OS that is not yet supported by PolicyWatcher code.
#endif
- return PolicyWatcher::CreateFromPolicyLoader(policy_loader.Pass());
+ return PolicyWatcher::CreateFromPolicyLoader(std::move(policy_loader));
#endif // !(OS_CHROMEOS)
}

Powered by Google App Engine
This is Rietveld 408576698