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

Unified Diff: chrome/browser/chromeos/proxy_config_service_impl.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: Fixed some memory leaks in tests. 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/proxy_config_service_impl.cc
diff --git a/chrome/browser/chromeos/proxy_config_service_impl.cc b/chrome/browser/chromeos/proxy_config_service_impl.cc
index 399965d0f7421a6a7da0145cd7826b81977b2520..2aa0291c7da58e972b46248545661e9e61016dae 100644
--- a/chrome/browser/chromeos/proxy_config_service_impl.cc
+++ b/chrome/browser/chromeos/proxy_config_service_impl.cc
@@ -656,16 +656,23 @@ net::ProxyConfigService::ConfigAvailability
void ProxyConfigServiceImpl::OnSettingsOpCompleted(
SignedSettings::ReturnCode code,
- std::string value) {
+ const base::Value* value) {
+ // We assume ownership here to make sure this gets deleted no matter where
+ // this function ends.
+ scoped_ptr<const base::Value> own_value(value);
+
retrieve_property_op_ = NULL;
if (code != SignedSettings::SUCCESS) {
LOG(WARNING) << "Error retrieving proxy setting from device";
device_config_.clear();
return;
}
- VLOG(1) << "Retrieved proxy setting from device, value=[" << value << "]";
+ std::string policy_value;
+ value->GetAsString(&policy_value);
+ VLOG(1) << "Retrieved proxy setting from device, value=["
+ << policy_value << "]";
ProxyConfig device_config;
- if (!device_config.DeserializeForDevice(value) ||
+ if (!device_config.DeserializeForDevice(policy_value) ||
!device_config.SerializeForNetwork(&device_config_)) {
LOG(WARNING) << "Can't deserialize device setting or serialize for network";
device_config_.clear();

Powered by Google App Engine
This is Rietveld 408576698