[shill] Make profiles backed with StoreInterfaces
Rely on persistence of data in StoreInterface to maintain
Service/Device/IPConfig info for entities that are not
currently active, instead of maintaining lists in Profile
objects themselves.
BUG=chromium-os:17253
TEST=unit, run on device
Change-Id: I206f44ddf16c584354f8fcadb57032f047f33d0a
Reviewed-on: http://gerrit.chromium.org/gerrit/10024
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/ephemeral_profile.cc b/ephemeral_profile.cc
index 75ccff6..672a098 100644
--- a/ephemeral_profile.cc
+++ b/ephemeral_profile.cc
@@ -25,8 +25,17 @@
EphemeralProfile::~EphemeralProfile() {}
-void EphemeralProfile::Finalize() {
- services()->clear();
+bool EphemeralProfile::AdoptService(const ServiceRefPtr &service) {
+ VLOG(2) << "Adding " << service->UniqueName() << " to ephemeral profile.";
+ service->set_profile(this);
+ return true;
+}
+
+bool EphemeralProfile::AbandonService(const ServiceRefPtr &service) {
+ if (service->profile() == this)
+ service->set_profile(NULL);
+ VLOG(2) << "Removing " << service->UniqueName() << " from ephemeral profile.";
+ return true;
}
bool EphemeralProfile::Save() {