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

Unified Diff: chrome/browser/chromeos/login/signed_settings_helper.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_helper.cc
diff --git a/chrome/browser/chromeos/login/signed_settings_helper.cc b/chrome/browser/chromeos/login/signed_settings_helper.cc
index b641b786c9d2681690ec6265f61e0349fba683d6..6822e14903ba203227a54908e3e289076fe904e9 100644
--- a/chrome/browser/chromeos/login/signed_settings_helper.cc
+++ b/chrome/browser/chromeos/login/signed_settings_helper.cc
@@ -168,12 +168,12 @@ class StorePropertyOpContext : public SignedSettings::Delegate<bool>,
public OpContext {
public:
StorePropertyOpContext(const std::string& name,
- const std::string& value,
+ const base::Value& value,
SignedSettingsHelper::Callback* callback,
OpContext::Delegate* delegate)
: OpContext(callback, delegate),
name_(name),
- value_(value) {
+ value_(value.DeepCopy()) {
}
// chromeos::SignedSettings::Delegate implementation
@@ -181,25 +181,25 @@ class StorePropertyOpContext : public SignedSettings::Delegate<bool>,
bool unused) OVERRIDE {
VLOG(2) << "OnSettingsOpCompleted, code = " << code;
if (callback_)
- callback_->OnStorePropertyCompleted(code, name_, value_);
+ callback_->OnStorePropertyCompleted(code, name_, *value_);
OnOpCompleted();
}
protected:
// OpContext implemenetation
virtual void CreateOp() OVERRIDE {
- op_ = SignedSettings::CreateStorePropertyOp(name_, value_, this);
+ op_ = SignedSettings::CreateStorePropertyOp(name_, *value_, this);
}
private:
std::string name_;
- std::string value_;
+ scoped_ptr<base::Value> value_;
DISALLOW_COPY_AND_ASSIGN(StorePropertyOpContext);
};
class RetrievePropertyOpContext
- : public SignedSettings::Delegate<std::string>,
+ : public SignedSettings::Delegate<const base::Value&>,
public OpContext {
public:
RetrievePropertyOpContext(const std::string& name,
@@ -211,7 +211,7 @@ class RetrievePropertyOpContext
// chromeos::SignedSettings::Delegate implementation
virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code,
- std::string value) OVERRIDE {
+ const base::Value& value) OVERRIDE {
if (callback_)
callback_->OnRetrievePropertyCompleted(code, name_, value);
@@ -301,7 +301,7 @@ class SignedSettingsHelperImpl : public SignedSettingsHelper,
bool add_to_whitelist,
Callback* callback) OVERRIDE;
virtual void StartStorePropertyOp(const std::string& name,
- const std::string& value,
+ const base::Value& value,
Callback* callback) OVERRIDE;
virtual void StartRetrieveProperty(const std::string& name,
Callback* callback) OVERRIDE;
@@ -365,7 +365,7 @@ void SignedSettingsHelperImpl::StartWhitelistOp(
void SignedSettingsHelperImpl::StartStorePropertyOp(
const std::string& name,
- const std::string& value,
+ const base::Value& value,
SignedSettingsHelper::Callback* callback) {
AddOpContext(new StorePropertyOpContext(
name,

Powered by Google App Engine
This is Rietveld 408576698