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

Unified Diff: chrome/browser/chromeos/login/signed_settings_temp_storage.cc

Issue 8091002: PART2: Make SignedSettings use proper Value types instead of string all around the place. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and rebased on a the current PART1 version. Created 9 years, 2 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/login/signed_settings_temp_storage.cc
diff --git a/chrome/browser/chromeos/login/signed_settings_temp_storage.cc b/chrome/browser/chromeos/login/signed_settings_temp_storage.cc
index 4182ff9c1633ca3542ee84e0aa22f9888b1c2c5c..021b3aafeade24edb18cbc8059512fe90ea10225 100644
--- a/chrome/browser/chromeos/login/signed_settings_temp_storage.cc
+++ b/chrome/browser/chromeos/login/signed_settings_temp_storage.cc
@@ -20,13 +20,13 @@ void SignedSettingsTempStorage::RegisterPrefs(PrefService* local_state) {
// static
bool SignedSettingsTempStorage::Store(const std::string& name,
- const std::string& value,
+ const base::Value& value,
PrefService* local_state) {
if (local_state) {
DictionaryPrefUpdate temp_storage_update(
local_state, prefs::kSignedSettingsTempStorage);
temp_storage_update->SetWithoutPathExpansion(
- name, Value::CreateStringValue(value));
+ name, value.DeepCopy());
return true;
}
return false;
@@ -34,13 +34,13 @@ bool SignedSettingsTempStorage::Store(const std::string& name,
// static
bool SignedSettingsTempStorage::Retrieve(const std::string& name,
- std::string* value,
+ base::Value** value,
PrefService* local_state) {
if (local_state) {
const DictionaryValue* temp_storage =
local_state->GetDictionary(prefs::kSignedSettingsTempStorage);
if (temp_storage && temp_storage->HasKey(name)) {
- temp_storage->GetStringWithoutPathExpansion(name, value);
+ temp_storage->GetWithoutPathExpansion(name, value);
return true;
}
}
@@ -61,9 +61,9 @@ void SignedSettingsTempStorage::Finalize(PrefService* local_state) {
for (DictionaryValue::key_iterator it = temp_storage->begin_keys();
it != temp_storage->end_keys();
++it) {
- std::string value;
- temp_storage->GetStringWithoutPathExpansion(*it, &value);
- SignedSettingsHelper::Get()->StartStorePropertyOp(*it, value, NULL);
+ base::Value* value;
+ temp_storage->GetWithoutPathExpansion(*it, &value);
Denis Lagno 2011/10/13 13:43:10 value contains garbage initially, and you do not c
pastarmovj 2011/10/26 15:44:59 Done.
+ SignedSettingsHelper::Get()->StartStorePropertyOp(*it, *value, NULL);
}
local_state->ClearPref(prefs::kSignedSettingsTempStorage);
}

Powered by Google App Engine
This is Rietveld 408576698