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

Unified Diff: chromeos/network/network_state.h

Issue 23441025: Clean up NetworkState members (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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: chromeos/network/network_state.h
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h
index 62edc03b34e2c6d7bc6333dbe03ae660b379c828..1377a4367df5c9be19c2fcc74be417302da92aac 100644
--- a/chromeos/network/network_state.h
+++ b/chromeos/network/network_state.h
@@ -23,8 +23,6 @@ namespace chromeos {
// the network.
class CHROMEOS_EXPORT NetworkState : public ManagedState {
public:
- typedef std::vector<int> FrequencyList;
-
explicit NetworkState(const std::string& path);
virtual ~NetworkState();
@@ -47,22 +45,23 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
const std::string& connection_state() const { return connection_state_; }
const std::string& profile_path() const { return profile_path_; }
const std::string& error() const { return error_; }
- bool auto_connect() const { return auto_connect_; }
- bool favorite() const { return favorite_; }
- int priority() const { return priority_; }
+ bool connectable() const { return connectable_; }
+
const base::DictionaryValue& proxy_config() const { return proxy_config_; }
const NetworkUIData& ui_data() const { return ui_data_; }
- // IPConfig Properties
+
+ // IPConfig Properties. These require an extra call to ShillIPConfigClient,
+ // so cache them to avoid excessively complex client code.
const std::string& ip_address() const { return ip_address_; }
const std::string& gateway() const { return gateway_; }
const std::vector<std::string>& dns_servers() const { return dns_servers_; }
- const int prefix_length() const { return prefix_length_; }
const GURL& web_proxy_auto_discovery_url() const {
return web_proxy_auto_discovery_url_;
}
+
// Wireless property accessors
int signal_strength() const { return signal_strength_; }
- bool connectable() const { return connectable_; }
+
// Cellular property accessors
const std::string& network_technology() const {
return network_technology_;
@@ -73,10 +72,6 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
return activate_over_non_cellular_networks_;
}
bool cellular_out_of_credits() const { return cellular_out_of_credits_; }
- const std::string& usage_url() const { return usage_url_; }
- const std::string& payment_url() const { return payment_url_; }
- const std::string& post_method() const { return post_method_; }
- const std::string& post_data() const { return post_data_; }
// Whether this network has a CACertNSS nickname set.
bool HasCACertNSS() const { return has_ca_cert_nss_; }
@@ -101,8 +96,7 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
static bool StateIsConnected(const std::string& connection_state);
static bool StateIsConnecting(const std::string& connection_state);
- // Helper to return a full prefixed version of an IPConfig property
- // key.
+ // Helper to return a full prefixed version of an IPConfig property key.
static std::string IPConfigProperty(const char* key);
// Sets |out| to the UIData specified by |value|. Returns true if successfully
@@ -124,44 +118,43 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
// Returns true if |name_| changes.
bool UpdateName(const base::DictionaryValue& properties);
- // TODO(gauravsh): Audit the list of properties that we are caching. We should
- // only be doing this for commonly accessed properties. crbug.com/252553
- // Common Network Service properties
+ // Network Service properties. Avoid adding any additional properties here.
+ // Instead use NetworkConfigurationHandler::GetProperties() to asynchronously
+ // request properties from Shill.
std::string security_;
std::string device_path_;
std::string guid_;
std::string connection_state_;
std::string profile_path_;
std::string error_;
- bool auto_connect_;
- bool favorite_;
- int priority_;
+ bool connectable_;
+
// TODO(pneubeck): Remove ProxyConfig once NetworkConfigurationHandler
- // provides proxy configuration. crbug/241775
+ // provides proxy configuration. crbug.com/241775
base::DictionaryValue proxy_config_;
+
+ // This is convenient to keep cached for now, but shouldn't be necessary;
+ // avoid using it if possible.
NetworkUIData ui_data_;
+
// IPConfig properties.
// Note: These do not correspond to actual Shill.Service properties
// but are derived from the service's corresponding IPConfig object.
std::string ip_address_;
std::string gateway_;
std::vector<std::string> dns_servers_;
- int prefix_length_;
+ int prefix_length_; // Used by GetNetmask()
GURL web_proxy_auto_discovery_url_;
- // Wireless properties
+
+ // Wireless properties, used for icons and Connect logic.
int signal_strength_;
- bool connectable_;
- // Cellular properties
+
+ // Cellular properties, used for icons, Connect, and Activation.
std::string network_technology_;
std::string activation_state_;
std::string roaming_;
bool activate_over_non_cellular_networks_;
bool cellular_out_of_credits_;
- // Cellular payment portal properties.
- std::string usage_url_;
- std::string payment_url_;
- std::string post_method_;
- std::string post_data_;
// Whether a deprecated CaCertNSS property of this network is set. Required
// for migration to PEM.

Powered by Google App Engine
This is Rietveld 408576698