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

Side by Side Diff: components/policy/core/browser/android/policy_converter.cc

Issue 1940153002: Use std::unique_ptr to express ownership of base::Value in PolicyMap::Entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another-fix Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/android/policy_converter.h" 5 #include "components/policy/core/browser/android/policy_converter.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 bool PolicyConverter::Register(JNIEnv* env) { 188 bool PolicyConverter::Register(JNIEnv* env) {
189 return RegisterNativesImpl(env); 189 return RegisterNativesImpl(env);
190 } 190 }
191 191
192 void PolicyConverter::SetPolicyValue(const std::string& key, 192 void PolicyConverter::SetPolicyValue(const std::string& key,
193 std::unique_ptr<base::Value> value) { 193 std::unique_ptr<base::Value> value) {
194 const Schema schema = policy_schema_->GetKnownProperty(key); 194 const Schema schema = policy_schema_->GetKnownProperty(key);
195 const PolicyNamespace ns(POLICY_DOMAIN_CHROME, std::string()); 195 const PolicyNamespace ns(POLICY_DOMAIN_CHROME, std::string());
196 policy_bundle_->Get(ns).Set( 196 policy_bundle_->Get(ns).Set(
197 key, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM, 197 key, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM,
198 ConvertValueToSchema(std::move(value), schema).release(), nullptr); 198 ConvertValueToSchema(std::move(value), schema), nullptr);
199 } 199 }
200 200
201 } // namespace android 201 } // namespace android
202 } // namespace policy 202 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/policy_ui_handler.cc ('k') | components/policy/core/browser/autofill_policy_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698