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

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

Issue 2257103002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 void KeyPermissions::RegisterProfilePrefs( 370 void KeyPermissions::RegisterProfilePrefs(
371 user_prefs::PrefRegistrySyncable* registry) { 371 user_prefs::PrefRegistrySyncable* registry) {
372 // For the format of the dictionary see the documentation at kPrefKeyUsage. 372 // For the format of the dictionary see the documentation at kPrefKeyUsage.
373 registry->RegisterDictionaryPref(prefs::kPlatformKeys); 373 registry->RegisterDictionaryPref(prefs::kPlatformKeys);
374 } 374 }
375 375
376 void KeyPermissions::CreatePermissionObjectAndPassToCallback( 376 void KeyPermissions::CreatePermissionObjectAndPassToCallback(
377 const std::string& extension_id, 377 const std::string& extension_id,
378 const PermissionsCallback& callback, 378 const PermissionsCallback& callback,
379 std::unique_ptr<base::Value> value) { 379 std::unique_ptr<base::Value> value) {
380 callback.Run(base::WrapUnique( 380 callback.Run(base::MakeUnique<PermissionsForExtension>(
381 new PermissionsForExtension(extension_id, std::move(value), 381 extension_id, std::move(value), profile_prefs_, profile_policies_, this));
382 profile_prefs_, profile_policies_, this)));
383 } 382 }
384 383
385 void KeyPermissions::SetPlatformKeysOfExtension( 384 void KeyPermissions::SetPlatformKeysOfExtension(
386 const std::string& extension_id, 385 const std::string& extension_id,
387 std::unique_ptr<base::Value> value) { 386 std::unique_ptr<base::Value> value) {
388 extensions_state_store_->SetExtensionValue( 387 extensions_state_store_->SetExtensionValue(
389 extension_id, kStateStorePlatformKeys, std::move(value)); 388 extension_id, kStateStorePlatformKeys, std::move(value));
390 } 389 }
391 390
392 const base::DictionaryValue* KeyPermissions::GetPrefsEntry( 391 const base::DictionaryValue* KeyPermissions::GetPrefsEntry(
393 const std::string& public_key_spki_der_b64) const { 392 const std::string& public_key_spki_der_b64) const {
394 const base::DictionaryValue* platform_keys = 393 const base::DictionaryValue* platform_keys =
395 profile_prefs_->GetDictionary(prefs::kPlatformKeys); 394 profile_prefs_->GetDictionary(prefs::kPlatformKeys);
396 395
397 const base::DictionaryValue* key_entry = nullptr; 396 const base::DictionaryValue* key_entry = nullptr;
398 platform_keys->GetDictionaryWithoutPathExpansion(public_key_spki_der_b64, 397 platform_keys->GetDictionaryWithoutPathExpansion(public_key_spki_der_b64,
399 &key_entry); 398 &key_entry);
400 return key_entry; 399 return key_entry;
401 } 400 }
402 401
403 } // namespace chromeos 402 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/net/proxy_config_handler.cc ('k') | chrome/browser/chromeos/platform_keys/platform_keys_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698