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

Unified Diff: chromeos/network/onc/onc_merger.cc

Issue 821643005: Provide GUID in ONC for all networks in ManagedNetworkConfigurationHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chromeos_unittests 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
« no previous file with comments | « chromeos/network/managed_network_configuration_handler_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_merger.cc
diff --git a/chromeos/network/onc/onc_merger.cc b/chromeos/network/onc/onc_merger.cc
index c2af97e800e4945b82ce4f232695b8a36d5ad5f0..51d8241bf218b5c90ffe39d48d2c71ac31cedfea 100644
--- a/chromeos/network/onc/onc_merger.cc
+++ b/chromeos/network/onc/onc_merger.cc
@@ -382,16 +382,18 @@ class MergeToAugmented : public MergeToEffective {
if (IsIdentifierField(*signature_, key)) {
// Don't augment the GUID but write the plain value.
- if (!effective_value) {
- LOG(ERROR) << "GUID field has no effective value";
- return nullptr;
+ if (effective_value) {
+ // DCHECK that all provided GUIDs are identical.
+ DCHECK(AllPresentValuesEqual(values, *effective_value));
+ // Return the un-augmented GUID.
+ return effective_value.Pass();
}
-
- // DCHECK that all provided GUIDs are identical.
- DCHECK(AllPresentValuesEqual(values, *effective_value));
-
- // Return the un-augmented GUID.
- return effective_value.Pass();
+ if (values.active_setting) {
+ // Unmanaged networks have assigned (active) GUID values.
+ return make_scoped_ptr(values.active_setting->DeepCopy());
+ }
+ LOG(ERROR) << "GUID field has no effective value";
+ return nullptr;
}
scoped_ptr<base::DictionaryValue> augmented_value(
« no previous file with comments | « chromeos/network/managed_network_configuration_handler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698