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

Side by Side Diff: chrome/browser/chromeos/platform_keys/key_permissions.cc

Issue 2811673002: Reland: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Workaround with std::move Created 3 years, 8 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 "chrome/browser/chromeos/platform_keys/key_permissions.h" 5 #include "chrome/browser/chromeos/platform_keys/key_permissions.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 WriteToStateStore(); 169 WriteToStateStore();
170 170
171 DictionaryPrefUpdate update(profile_prefs_, prefs::kPlatformKeys); 171 DictionaryPrefUpdate update(profile_prefs_, prefs::kPlatformKeys);
172 172
173 std::unique_ptr<base::DictionaryValue> new_pref_entry( 173 std::unique_ptr<base::DictionaryValue> new_pref_entry(
174 new base::DictionaryValue); 174 new base::DictionaryValue);
175 new_pref_entry->SetStringWithoutPathExpansion(kPrefKeyUsage, 175 new_pref_entry->SetStringWithoutPathExpansion(kPrefKeyUsage,
176 kPrefKeyUsageCorporate); 176 kPrefKeyUsageCorporate);
177 177
178 update->SetWithoutPathExpansion(public_key_spki_der_b64, 178 update->SetWithoutPathExpansion(public_key_spki_der_b64,
179 new_pref_entry.release()); 179 std::move(new_pref_entry));
180 } 180 }
181 181
182 void KeyPermissions::PermissionsForExtension::SetUserGrantedPermission( 182 void KeyPermissions::PermissionsForExtension::SetUserGrantedPermission(
183 const std::string& public_key_spki_der) { 183 const std::string& public_key_spki_der) {
184 if (!key_permissions_->CanUserGrantPermissionFor(public_key_spki_der)) { 184 if (!key_permissions_->CanUserGrantPermissionFor(public_key_spki_der)) {
185 LOG(WARNING) << "Tried to grant permission for a key although prohibited " 185 LOG(WARNING) << "Tried to grant permission for a key although prohibited "
186 "(either key is a corporate key or this account is " 186 "(either key is a corporate key or this account is "
187 "managed)."; 187 "managed).";
188 return; 188 return;
189 } 189 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 const base::DictionaryValue* platform_keys = 393 const base::DictionaryValue* platform_keys =
394 profile_prefs_->GetDictionary(prefs::kPlatformKeys); 394 profile_prefs_->GetDictionary(prefs::kPlatformKeys);
395 395
396 const base::DictionaryValue* key_entry = nullptr; 396 const base::DictionaryValue* key_entry = nullptr;
397 platform_keys->GetDictionaryWithoutPathExpansion(public_key_spki_der_b64, 397 platform_keys->GetDictionaryWithoutPathExpansion(public_key_spki_der_b64,
398 &key_entry); 398 &key_entry);
399 return key_entry; 399 return key_entry;
400 } 400 }
401 401
402 } // namespace chromeos 402 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698