diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-20 20:37:55 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-20 20:37:55 +0000 |
commit | 09d7a3aa84aa2b5f71c4ae65cb63c26e81bfb05e (patch) | |
tree | 78feb2452b9537b514c13fffa8e849700ac74547 /chrome/browser/chromeos/cros/network_library.cc | |
parent | 368be757a0f915b50048dc82e8ed9801c7a8a2b7 (diff) | |
download | chromium_src-09d7a3aa84aa2b5f71c4ae65cb63c26e81bfb05e.zip chromium_src-09d7a3aa84aa2b5f71c4ae65cb63c26e81bfb05e.tar.gz chromium_src-09d7a3aa84aa2b5f71c4ae65cb63c26e81bfb05e.tar.bz2 |
Add copy and assignment to FundamentalValue and StringValue.
Also get rid of use of CreateStringValue in chromeos/ directory.
This is a retry of r167808, but adding the copy and assign constructors fixes a clang compile error.
BUG=160586
Review URL: https://chromiumcodereview.appspot.com/11418048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/cros/network_library.cc')
-rw-r--r-- | chrome/browser/chromeos/cros/network_library.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc index 8600d88..f2f4a8c 100644 --- a/chrome/browser/chromeos/cros/network_library.cc +++ b/chrome/browser/chromeos/cros/network_library.cc @@ -359,12 +359,11 @@ bool Network::RequiresUserProfile() const { void Network::CopyCredentialsFromRemembered(Network* remembered) { } -void Network::SetValueProperty(const char* prop, Value* value) { +void Network::SetValueProperty(const char* prop, const base::Value& value) { DCHECK(prop); - DCHECK(value); if (!EnsureCrosLoaded()) return; - CrosSetNetworkServiceProperty(service_path_, prop, *value); + CrosSetNetworkServiceProperty(service_path_, prop, value); } void Network::ClearProperty(const char* prop) { @@ -378,8 +377,7 @@ void Network::SetStringProperty( const char* prop, const std::string& str, std::string* dest) { if (dest) *dest = str; - scoped_ptr<Value> value(Value::CreateStringValue(str)); - SetValueProperty(prop, value.get()); + SetValueProperty(prop, base::StringValue(str)); } void Network::SetOrClearStringProperty(const char* prop, @@ -397,15 +395,13 @@ void Network::SetOrClearStringProperty(const char* prop, void Network::SetBooleanProperty(const char* prop, bool b, bool* dest) { if (dest) *dest = b; - scoped_ptr<Value> value(Value::CreateBooleanValue(b)); - SetValueProperty(prop, value.get()); + SetValueProperty(prop, base::FundamentalValue(b)); } void Network::SetIntegerProperty(const char* prop, int i, int* dest) { if (dest) *dest = i; - scoped_ptr<Value> value(Value::CreateIntegerValue(i)); - SetValueProperty(prop, value.get()); + SetValueProperty(prop, base::FundamentalValue(i)); } void Network::SetPreferred(bool preferred) { @@ -884,7 +880,7 @@ void CellularNetwork::SetApn(const CellularApn& apn) { value.SetString(flimflam::kApnNetworkIdProperty, apn.network_id); value.SetString(flimflam::kApnUsernameProperty, apn.username); value.SetString(flimflam::kApnPasswordProperty, apn.password); - SetValueProperty(flimflam::kCellularApnProperty, &value); + SetValueProperty(flimflam::kCellularApnProperty, value); } else { ClearProperty(flimflam::kCellularApnProperty); } |