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

Side by Side Diff: components/policy/core/browser/configuration_policy_handler.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/policy/core/browser/configuration_policy_handler.h" 5 #include "components/policy/core/browser/configuration_policy_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 entry - list_value->begin(), 209 entry - list_value->begin(),
210 IDS_POLICY_TYPE_ERROR, 210 IDS_POLICY_TYPE_ERROR,
211 ValueTypeToString(base::Value::TYPE_STRING)); 211 ValueTypeToString(base::Value::TYPE_STRING));
212 } 212 }
213 continue; 213 continue;
214 } 214 }
215 215
216 std::unique_ptr<base::Value> mapped_value = Map(entry_value); 216 std::unique_ptr<base::Value> mapped_value = Map(entry_value);
217 if (mapped_value) { 217 if (mapped_value) {
218 if (output) 218 if (output)
219 output->Append(mapped_value.release()); 219 output->Append(std::move(mapped_value));
220 } else { 220 } else {
221 if (errors) { 221 if (errors) {
222 errors->AddError(policy_name(), 222 errors->AddError(policy_name(),
223 entry - list_value->begin(), 223 entry - list_value->begin(),
224 IDS_POLICY_OUT_OF_RANGE_ERROR); 224 IDS_POLICY_OUT_OF_RANGE_ERROR);
225 } 225 }
226 } 226 }
227 } 227 }
228 228
229 return true; 229 return true;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 } 486 }
487 } 487 }
488 } 488 }
489 void LegacyPoliciesDeprecatingPolicyHandler::ApplyPolicySettings( 489 void LegacyPoliciesDeprecatingPolicyHandler::ApplyPolicySettings(
490 const policy::PolicyMap& /* policies */, 490 const policy::PolicyMap& /* policies */,
491 PrefValueMap* /* prefs */) { 491 PrefValueMap* /* prefs */) {
492 NOTREACHED(); 492 NOTREACHED();
493 } 493 }
494 494
495 } // namespace policy 495 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698