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

Side by Side Diff: chromeos/network/network_state.cc

Issue 207183003: Cleanup network event logging, add to ManagedNetworkConfigurationHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/network/network_state.h" 5 #include "chromeos/network/network_state.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chromeos/network/network_event_log.h" 9 #include "chromeos/network/network_event_log.h"
10 #include "chromeos/network/network_profile_handler.h" 10 #include "chromeos/network/network_profile_handler.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_); 151 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_);
152 } else if (key == shill::kOutOfCreditsProperty) { 152 } else if (key == shill::kOutOfCreditsProperty) {
153 return GetBooleanValue(key, value, &cellular_out_of_credits_); 153 return GetBooleanValue(key, value, &cellular_out_of_credits_);
154 } 154 }
155 return false; 155 return false;
156 } 156 }
157 157
158 bool NetworkState::InitialPropertiesReceived( 158 bool NetworkState::InitialPropertiesReceived(
159 const base::DictionaryValue& properties) { 159 const base::DictionaryValue& properties) {
160 NET_LOG_DEBUG("InitialPropertiesReceived", path()); 160 NET_LOG_DEBUG("InitialPropertiesReceived", path());
161 bool changed = UpdateName(properties); 161 bool changed = false;
162 if (!properties.HasKey(shill::kTypeProperty)) {
pneubeck (no reviews) 2014/03/21 09:33:42 isn't in this case the NetworkState broken and wil
stevenjb 2014/03/21 17:08:51 I put these checks in everywhere to track down the
163 NET_LOG_ERROR("NetworkState has no type",
164 shill_property_util::GetNetworkIdFromProperties(properties));
165 } else {
166 changed |= UpdateName(properties);
167 }
162 bool had_ca_cert_nss = has_ca_cert_nss_; 168 bool had_ca_cert_nss = has_ca_cert_nss_;
163 has_ca_cert_nss_ = IsCaCertNssSet(properties); 169 has_ca_cert_nss_ = IsCaCertNssSet(properties);
164 changed |= had_ca_cert_nss != has_ca_cert_nss_; 170 changed |= had_ca_cert_nss != has_ca_cert_nss_;
165 return changed; 171 return changed;
166 } 172 }
167 173
168 void NetworkState::GetProperties(base::DictionaryValue* dictionary) const { 174 void NetworkState::GetProperties(base::DictionaryValue* dictionary) const {
169 // Keep care that these properties are the same as in |PropertyChanged|. 175 // Keep care that these properties are the same as in |PropertyChanged|.
170 dictionary->SetStringWithoutPathExpansion(shill::kNameProperty, name()); 176 dictionary->SetStringWithoutPathExpansion(shill::kNameProperty, name());
171 dictionary->SetStringWithoutPathExpansion(shill::kTypeProperty, type()); 177 dictionary->SetStringWithoutPathExpansion(shill::kTypeProperty, type());
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 connection_state == shill::kStateConfiguration || 282 connection_state == shill::kStateConfiguration ||
277 connection_state == shill::kStateCarrier); 283 connection_state == shill::kStateCarrier);
278 } 284 }
279 285
280 // static 286 // static
281 std::string NetworkState::IPConfigProperty(const char* key) { 287 std::string NetworkState::IPConfigProperty(const char* key) {
282 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); 288 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key);
283 } 289 }
284 290
285 } // namespace chromeos 291 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698