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

Unified Diff: chrome/browser/chromeos/platform_keys/key_permissions.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/platform_keys/key_permissions.cc
diff --git a/chrome/browser/chromeos/platform_keys/key_permissions.cc b/chrome/browser/chromeos/platform_keys/key_permissions.cc
index 8869e4b4af13f29ee75ba482fd87129deed8138c..4f208e5921bfa39903ecdf80578f0535bb150eb6 100644
--- a/chrome/browser/chromeos/platform_keys/key_permissions.cc
+++ b/chrome/browser/chromeos/platform_keys/key_permissions.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "chrome/common/pref_names.h"
#include "components/policy/core/common/policy_map.h"
@@ -88,7 +89,7 @@ struct KeyPermissions::PermissionsForExtension::KeyEntry {
KeyPermissions::PermissionsForExtension::PermissionsForExtension(
const std::string& extension_id,
- scoped_ptr<base::Value> state_store_value,
+ std::unique_ptr<base::Value> state_store_value,
PrefService* profile_prefs,
policy::PolicyService* profile_policies,
KeyPermissions* key_permissions)
@@ -169,7 +170,8 @@ void KeyPermissions::PermissionsForExtension::RegisterKeyForCorporateUsage(
DictionaryPrefUpdate update(profile_prefs_, prefs::kPlatformKeys);
- scoped_ptr<base::DictionaryValue> new_pref_entry(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> new_pref_entry(
+ new base::DictionaryValue);
new_pref_entry->SetStringWithoutPathExpansion(kPrefKeyUsage,
kPrefKeyUsageCorporate);
@@ -274,15 +276,15 @@ void KeyPermissions::PermissionsForExtension::KeyEntriesFromState(
}
}
-scoped_ptr<base::Value>
+std::unique_ptr<base::Value>
KeyPermissions::PermissionsForExtension::KeyEntriesToState() {
- scoped_ptr<base::ListValue> new_state(new base::ListValue);
+ std::unique_ptr<base::ListValue> new_state(new base::ListValue);
for (const KeyEntry& entry : state_store_entries_) {
// Drop entries that the extension doesn't have any permissions for anymore.
if (!entry.sign_once && !entry.sign_unlimited)
continue;
- scoped_ptr<base::DictionaryValue> new_entry(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> new_entry(new base::DictionaryValue);
new_entry->SetStringWithoutPathExpansion(kStateStoreSPKI, entry.spki_b64);
// Omit writing default values, namely |false|.
if (entry.sign_once) {
@@ -374,14 +376,15 @@ void KeyPermissions::RegisterProfilePrefs(
void KeyPermissions::CreatePermissionObjectAndPassToCallback(
const std::string& extension_id,
const PermissionsCallback& callback,
- scoped_ptr<base::Value> value) {
- callback.Run(make_scoped_ptr(
+ std::unique_ptr<base::Value> value) {
+ callback.Run(base::WrapUnique(
new PermissionsForExtension(extension_id, std::move(value),
profile_prefs_, profile_policies_, this)));
}
-void KeyPermissions::SetPlatformKeysOfExtension(const std::string& extension_id,
- scoped_ptr<base::Value> value) {
+void KeyPermissions::SetPlatformKeysOfExtension(
+ const std::string& extension_id,
+ std::unique_ptr<base::Value> value) {
extensions_state_store_->SetExtensionValue(
extension_id, kStateStorePlatformKeys, std::move(value));
}
« no previous file with comments | « chrome/browser/chromeos/platform_keys/key_permissions.h ('k') | chrome/browser/chromeos/platform_keys/platform_keys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698