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

Unified Diff: components/policy/core/common/cloud/component_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/component_cloud_policy_store.cc
diff --git a/components/policy/core/common/cloud/component_cloud_policy_store.cc b/components/policy/core/common/cloud/component_cloud_policy_store.cc
index f04df0085575bd8af12e3a510f241dced5ab7bed..15f9c24d8f9f0adb80776bd8de0ad28c51730620 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_store.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_store.cc
@@ -5,6 +5,7 @@
#include "components/policy/core/common/cloud/component_cloud_policy_store.h"
#include <stddef.h>
+#include <utility>
#include "base/callback.h"
#include "base/json/json_reader.h"
@@ -137,8 +138,8 @@ void ComponentCloudPolicyStore::Load() {
scoped_ptr<em::PolicyFetchResponse> proto(new em::PolicyFetchResponse);
em::ExternalPolicyData payload;
if (!proto->ParseFromString(it->second) ||
- !ValidateProto(
- proto.Pass(), constants.policy_type, id, &payload, NULL)) {
+ !ValidateProto(std::move(proto), constants.policy_type, id, &payload,
+ NULL)) {
Delete(ns);
continue;
}
@@ -253,8 +254,8 @@ bool ComponentCloudPolicyStore::ValidatePolicy(
PolicyNamespace* ns,
em::ExternalPolicyData* payload) {
em::PolicyData policy_data;
- if (!ValidateProto(
- proto.Pass(), std::string(), std::string(), payload, &policy_data)) {
+ if (!ValidateProto(std::move(proto), std::string(), std::string(), payload,
+ &policy_data)) {
return false;
}
@@ -282,7 +283,7 @@ bool ComponentCloudPolicyStore::ValidateProto(
scoped_ptr<ComponentCloudPolicyValidator> validator(
ComponentCloudPolicyValidator::Create(
- proto.Pass(), scoped_refptr<base::SequencedTaskRunner>()));
+ std::move(proto), scoped_refptr<base::SequencedTaskRunner>()));
validator->ValidateUsername(username_, true);
validator->ValidateDMToken(dm_token_,
ComponentCloudPolicyValidator::DM_TOKEN_REQUIRED);

Powered by Google App Engine
This is Rietveld 408576698