From 9842441bbfae81053a6c08045f1d7b831e5101b2 Mon Sep 17 00:00:00 2001 From: mukesh agrawal Date: Tue, 30 Sep 2014 15:21:52 -0700 Subject: shill: improve handling of profiles in WiFiProvider Sometimes, WiFiProvider uses a default profile. Other times, WiFiProvider uses a user profile. This is all well and good, but it's hard to follow which case is which. Resolve this problem, by giving WiFiProvider explict default_profile_ and user_profile_ fields. Most existing tests were updated to explicitly use the default_profile_. While there: - Clean up how default profiles are identified. (Do this via a method in Profile, rather than a method in Manager.) - Fix a whitespace issue in wifi_provider.cc. - Remove some unused local variables in wifi_provider_unittest.cc. BUG=chromium:419152 TEST=unit tests (on peppy) Change-Id: Id1d04ad8f112ff4ee6e8d31b10413dbc1dc94350 Reviewed-on: https://chromium-review.googlesource.com/220670 Tested-by: mukesh agrawal Reviewed-by: Paul Stewart Commit-Queue: mukesh agrawal --- profile.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'profile.h') diff --git a/profile.h b/profile.h index 482fefad..26b6b19f 100644 --- a/profile.h +++ b/profile.h @@ -181,11 +181,17 @@ class Profile : public base::RefCounted { // Returns the user_hash component of the profile identifier. const std::string &GetUserHash() const { return name_.user_hash; } + virtual StoreInterface *GetStorage() { + return storage_.get(); + } + // Returns a read-only copy of the backing storage of the profile. virtual const StoreInterface *GetConstStorage() const { return storage_.get(); } + virtual bool IsDefault() const { return false; } + protected: // Protected getters Metrics *metrics() const { return metrics_; } -- cgit v1.2.3