shill: Acquire IP once the cellular interface is up.

BUG=chromium-os:19175
TEST=unit tests, tested on device

Change-Id: Id319b155047e8e7d6886a28f4d682185104f317f
Reviewed-on: http://gerrit.chromium.org/gerrit/6029
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
diff --git a/device.h b/device.h
index 2bb068d..6998f39 100644
--- a/device.h
+++ b/device.h
@@ -21,6 +21,7 @@
 namespace shill {
 
 class ControlInterface;
+class DHCPProvider;
 class DeviceAdaptorInterface;
 class DeviceInfo;
 class Endpoint;
@@ -77,6 +78,8 @@
   bool Load(StoreInterface *storage);
   bool Save(StoreInterface *storage);
 
+  void set_dhcp_provider(DHCPProvider *provider) { dhcp_provider_ = provider; }
+
  protected:
   FRIEND_TEST(DeviceTest, AcquireDHCPConfig);
   FRIEND_TEST(DeviceTest, DestroyIPConfig);
@@ -134,6 +137,9 @@
 
   scoped_ptr<DeviceAdaptorInterface> adaptor_;
 
+  // Cache singleton pointer for performance and test purposes.
+  DHCPProvider *dhcp_provider_;
+
   DISALLOW_COPY_AND_ASSIGN(Device);
 };