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_provider.cc b/wimax_provider.cc
index 684b72d..3cbddb3 100644
--- a/wimax_provider.cc
+++ b/wimax_provider.cc
@@ -85,9 +85,11 @@
   // Removes dead networks from |networks_|.
   for (map<RpcIdentifier, NetworkInfo>::iterator it = networks_.begin();
        it != networks_.end(); ) {
-    if (ContainsKey(live_networks, it->first)) {
+    const RpcIdentifier &path = it->first;
+    if (ContainsKey(live_networks, path)) {
       ++it;
     } else {
+      LOG(INFO) << "WiMAX network disappeared: " << path;
       networks_.erase(it++);
     }
   }
@@ -255,7 +257,9 @@
     if (find(live_devices.begin(), live_devices.end(), it->second->path()) ==
         live_devices.end()) {
       LOG(INFO) << "Destroying device: " << it->first;
-      manager_->device_info()->DeregisterDevice(it->second);
+      const WiMaxRefPtr &device = it->second;
+      device->OnDeviceVanished();
+      manager_->device_info()->DeregisterDevice(device);
       devices_.erase(it++);
     } else {
       ++it;
@@ -276,6 +280,7 @@
     // Nothing to do, the network info is already available.
     return;
   }
+  LOG(INFO) << "WiMAX network appeared: " << path;
   scoped_ptr<WiMaxNetworkProxyInterface> proxy(
       proxy_factory_->CreateWiMaxNetworkProxy(path));
   Error error;