summaryrefslogtreecommitdiff
path: root/ephemeral_profile.cc
diff options
context:
space:
mode:
authorChris Masone <cmasone@chromium.org>2011-07-12 13:23:19 -0700
committerChris Masone <cmasone@chromium.org>2011-07-15 12:31:17 -0700
commit6791a43add38926966bd420e89541717fb2cb2b5 (patch)
treeab4884ebfe769ff7be8ffd1772921cd240ed8738 /ephemeral_profile.cc
parent887f2983bc84acc15139df257e43217fec1f6cdb (diff)
downloadshill-6791a43add38926966bd420e89541717fb2cb2b5.tar.gz
[shill] Enable Profile objects to manage a list of Services to persist.
The Manager will hang on to a list of active services. They will be sorted, someday, in an order that makes sense. Every service will be associated with a Profile, though it may the an ephemeral profile that won't persist state to disk. Profiles will maintain a map of service name to service references to track the services whose state they persist to disk. Services may move between Profiles, and will certainly need to be bound to one after they are registered with the Manager, so support for this is provided as well. BUG=chromium-os:17436 TEST=unit tests Change-Id: Id43a0e1d97302b6f574bd2213d4f3d176bb5223f Reviewed-on: http://gerrit.chromium.org/gerrit/4033 Reviewed-by: Chris Masone <cmasone@chromium.org> Tested-by: Chris Masone <cmasone@chromium.org>
Diffstat (limited to 'ephemeral_profile.cc')
-rw-r--r--ephemeral_profile.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/ephemeral_profile.cc b/ephemeral_profile.cc
index 1009877b..c5a36303 100644
--- a/ephemeral_profile.cc
+++ b/ephemeral_profile.cc
@@ -21,19 +21,13 @@ namespace shill {
EphemeralProfile::EphemeralProfile(ControlInterface *control_interface,
GLib *glib,
Manager *manager)
- : Profile(control_interface, glib),
- manager_(manager) {
+ : Profile(control_interface, glib, manager) {
}
EphemeralProfile::~EphemeralProfile() {}
-bool EphemeralProfile::MoveToActiveProfile(const std::string &name) {
- map<string, ServiceRefPtr>::iterator it = services_.find(name);
- if (it == services_.end())
- return false;
- manager_->ActiveProfile()->AdoptService(name, it->second);
- services_.erase(it);
- return true;
+void EphemeralProfile::Finalize() {
+ services_.clear();
}
} // namespace shill