shill: Fixes disconnect UMA stat

To determine the kernel's disconnect notification behaviour for these
UMA stats, I originally reverse-engineered the disconnect netlink
messages that we get from the kernel (should have looked at the kernel
code which, eventually, I did).  I found, erroneously, that all of the
disconnect reasons were found in the disassociate message.  It turns out
that the disconnect reasons are from the disassociate message only for
(some!) disconnections instigated by the station.  When the AP is the
source of the disconnect, the reason is stored in a disconnect message.

This code, then, extracts the reason code from whatever message type
(disconnect or disassociate) that contains one.  The message will still
be a little noisy since some station-started disconnections don't
provide a disassociate message and I've noticed that some AP-started
disconnections seem to send 2 messages.  I haven't tracked any of this
down.

BUG=chromium:215808
TEST=unittest (new) and manual - I test using the AP and description
found in chromium:294315.
CQ-DEPEND=Icf79aa729b1ed125743686c4536fe1b59183fed2

Change-Id: If648d530c613f485c074acf58ddb0bca4de22084
Reviewed-on: https://chromium-review.googlesource.com/170926
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Commit-Queue: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
diff --git a/metrics.h b/metrics.h
index 4091582..fc214de 100644
--- a/metrics.h
+++ b/metrics.h
@@ -507,8 +507,8 @@
       int response_time_milliseconds);
 
   // Notifies this object of WiFi disconnect.
-  void Notify80211Disconnect(WiFiDisconnectByWhom by_whom,
-                             IEEE_80211::WiFiReasonCode reason);
+  virtual void Notify80211Disconnect(WiFiDisconnectByWhom by_whom,
+                                     IEEE_80211::WiFiReasonCode reason);
 
   // Registers a device with this object so the device can use the timers to
   // track state transition metrics.