shill: wimax: Handle vanishing RPC devices promptly.

As soon as an RPC device vanishes, destroy its proxy, fail any
associated services and disable the device. This ensures that we won't
try to explicitly call Disable on the non-existent RPC device and
prevents any race between the RPC device disappearing and then
appearing shortly thereafter -- shill will create a new WiMax device
for the new device instance. Disabling the device also clears the live
network set and updates the provider state.

Also, promote basic WiMAX create/destroy logging to the INFO level.

BUG=chrome-os-partner:9832
TEST=unit tests

Change-Id: Ib4467f2f6c9dfb58c8b73173923b0bd9535dbb61
Reviewed-on: https://gerrit.chromium.org/gerrit/24379
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/wimax.h b/wimax.h
index 58f6af9..c42699f 100644
--- a/wimax.h
+++ b/wimax.h
@@ -42,6 +42,10 @@
   // Signaled by |service| when stopped.
   virtual void OnServiceStopped(const WiMaxServiceRefPtr &service);
 
+  // Signaled by WiMaxProvider when the RPC device disappears. The provider will
+  // deregister and destroy the device after invoking this method.
+  virtual void OnDeviceVanished();
+
   const RpcIdentifier &path() const { return path_; }
   bool scanning() const { return scanning_; }
   const std::set<RpcIdentifier> &networks() const { return networks_; }
@@ -49,7 +53,9 @@
  private:
   friend class WiMaxTest;
   FRIEND_TEST(WiMaxProviderTest, OnNetworksChanged);
+  FRIEND_TEST(WiMaxTest, DropService);
   FRIEND_TEST(WiMaxTest, OnConnectComplete);
+  FRIEND_TEST(WiMaxTest, OnDeviceVanished);
   FRIEND_TEST(WiMaxTest, OnNetworksChanged);
   FRIEND_TEST(WiMaxTest, OnServiceStopped);
   FRIEND_TEST(WiMaxTest, OnStatusChanged);
@@ -68,6 +74,7 @@
   void OnNetworksChanged(const RpcIdentifiers &networks);
   void OnStatusChanged(wimax_manager::DeviceStatus status);
 
+  void DropService(Service::ConnectState state);
   void DropConnection();
 
   const RpcIdentifier path_;