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

Unified Diff: components/wifi_sync/network_state_helper_chromeos.cc

Issue 809803005: wifi_sync: add ability to convert WifiCredential to onc properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-4.0-wifi-security-class
Patch Set: add validation, return onc_properties via scoped_ptr, fix nits Created 5 years, 11 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: components/wifi_sync/network_state_helper_chromeos.cc
diff --git a/components/wifi_sync/network_state_helper_chromeos.cc b/components/wifi_sync/network_state_helper_chromeos.cc
index 54b853527ca2cbe55616ec307c9d75bae14f6c90..9203cceb1b95aebaf1a29d0879051c81ff317df8 100644
--- a/components/wifi_sync/network_state_helper_chromeos.cc
+++ b/components/wifi_sync/network_state_helper_chromeos.cc
@@ -36,10 +36,16 @@ WifiCredential::CredentialSet GetWifiCredentialsForShillProfile(
// TODO(quiche): Fill in the actual passphrase via an asynchronous
// call to a chromeos::NetworkConfigurationHandler instance's
// GetProperties method.
- credentials.insert(
- WifiCredential(network->raw_ssid(),
- WifiSecurityClassFromShillSecurity(network->security()),
- "" /* empty passphrase */));
+ scoped_ptr<WifiCredential> credential =
+ WifiCredential::Create(
+ network->raw_ssid(),
+ WifiSecurityClassFromShillSecurity(network->security()),
+ "" /* empty passphrase */);
+ if (!credential) {
+ LOG(ERROR) << "Failed to create credential";
+ } else {
+ credentials.insert(*credential);
+ }
}
return credentials;
}

Powered by Google App Engine
This is Rietveld 408576698