[shill] Back property storage in Service objects with Entry objects

Much of Shill Service state is persisted to disk, by creating an Entry
in a Profile.  We should store this info just once, so that we don't
have to worry about keeping multiple data stores in sync.  This is a
first step in that direction.

BUG=chromium-os:17436
TEST=unit tests

Change-Id: If94db2a38a7d79c56e2c746b2f069cfd7ab4bf65
Reviewed-on: http://gerrit.chromium.org/gerrit/3876
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
diff --git a/profile.cc b/profile.cc
index c1e92a4..e03c09e 100644
--- a/profile.cc
+++ b/profile.cc
@@ -12,7 +12,9 @@
 
 #include "shill/adaptor_interfaces.h"
 #include "shill/control_interface.h"
+#include "shill/entry.h"
 #include "shill/property_accessor.h"
+#include "shill/service.h"
 
 using std::string;
 
@@ -43,6 +45,12 @@
 
 Profile::~Profile() {}
 
+void Profile::AdoptEntry(const std::string &entry_name,
+                         const EntryRefPtr &entry) {
+  entry->profile_name = name();
+  entries_[entry_name] = entry;
+}
+
 bool Profile::IsValidIdentifierToken(const std::string &token) {
   if (token.empty()) {
     return false;