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

Unified Diff: components/policy/core/common/cloud/user_cloud_policy_store.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers 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: components/policy/core/common/cloud/user_cloud_policy_store.cc
diff --git a/components/policy/core/common/cloud/user_cloud_policy_store.cc b/components/policy/core/common/cloud/user_cloud_policy_store.cc
index f86ea806d250c28bf27f9c178eeeb10b37f99e66..9240d06ec0823f82a88770e12902da06c2c15248 100644
--- a/components/policy/core/common/cloud/user_cloud_policy_store.cc
+++ b/components/policy/core/common/cloud/user_cloud_policy_store.cc
@@ -5,6 +5,7 @@
#include "components/policy/core/common/cloud/user_cloud_policy_store.h"
#include <stddef.h>
+#include <utility>
#include "base/bind.h"
#include "base/files/file_util.h"
@@ -270,16 +271,13 @@ void UserCloudPolicyStore::PolicyLoaded(bool validate_in_background,
// we've done our first key rotation).
}
- Validate(cloud_policy.Pass(),
- key.Pass(),
- verification_key,
- validate_in_background,
- base::Bind(
- &UserCloudPolicyStore::InstallLoadedPolicyAfterValidation,
- weak_factory_.GetWeakPtr(),
- doing_key_rotation,
- result.key.has_signing_key() ?
- result.key.signing_key() : std::string()));
+ Validate(
+ std::move(cloud_policy), std::move(key), verification_key,
+ validate_in_background,
+ base::Bind(&UserCloudPolicyStore::InstallLoadedPolicyAfterValidation,
+ weak_factory_.GetWeakPtr(), doing_key_rotation,
+ result.key.has_signing_key() ? result.key.signing_key()
+ : std::string()));
break;
}
default:
@@ -317,7 +315,8 @@ void UserCloudPolicyStore::InstallLoadedPolicyAfterValidation(
policy_key_ = signing_key;
}
- InstallPolicy(validator->policy_data().Pass(), validator->payload().Pass());
+ InstallPolicy(std::move(validator->policy_data()),
+ std::move(validator->payload()));
status_ = STATUS_OK;
NotifyStoreLoaded();
}
@@ -328,10 +327,8 @@ void UserCloudPolicyStore::Store(const em::PolicyFetchResponse& policy) {
weak_factory_.InvalidateWeakPtrs();
scoped_ptr<em::PolicyFetchResponse> policy_copy(
new em::PolicyFetchResponse(policy));
- Validate(policy_copy.Pass(),
- scoped_ptr<em::PolicySigningKey>(),
- verification_key_,
- true,
+ Validate(std::move(policy_copy), scoped_ptr<em::PolicySigningKey>(),
+ verification_key_, true,
base::Bind(&UserCloudPolicyStore::StorePolicyAfterValidation,
weak_factory_.GetWeakPtr()));
}
@@ -344,8 +341,7 @@ void UserCloudPolicyStore::Validate(
const UserCloudPolicyValidator::CompletionCallback& callback) {
// Configure the validator.
scoped_ptr<UserCloudPolicyValidator> validator = CreateValidator(
- policy.Pass(),
- CloudPolicyValidatorBase::TIMESTAMP_NOT_BEFORE);
+ std::move(policy), CloudPolicyValidatorBase::TIMESTAMP_NOT_BEFORE);
// Extract the owning domain from the signed-in user (if any is set yet).
// If there's no owning domain, then the code just ensures that the policy
@@ -451,7 +447,8 @@ void UserCloudPolicyStore::StorePolicyAfterValidation(
base::Bind(&StorePolicyToDiskOnBackgroundThread,
policy_path_, key_path_, verification_key_,
*validator->policy()));
- InstallPolicy(validator->policy_data().Pass(), validator->payload().Pass());
+ InstallPolicy(std::move(validator->policy_data()),
+ std::move(validator->payload()));
// If the key was rotated, update our local cache of the key.
if (validator->policy()->has_new_public_key())

Powered by Google App Engine
This is Rietveld 408576698