shill: Add cellular hooks for suspend and termination

When ChromeOS suspends or shill terminates, a cellular device should
disconnect from the cellular service.  This CL adds methods to do that
and connects them to the manager's hook table.  The manager runs these
actions when there is a terminate signal.  The shill Daemon has been
modified to signal the manager on a terminate signal.  TODO: Run these
actions on a suspend signal.

This CL modifies the HookTable API to remove the polling action.
Instead, actions are expected to call HookTable::ActionComplete()
to signal the completion of an action.

BUG=chromium-os:22408
TEST=new unittests; ran all existing unittests.  Manual testing
includes executing 'stop shill' and looking at log messages to make
sure the termination actions occurred.

Change-Id: I5bbf0832e76a5c818724fbca4c436beb3e5d182b
Reviewed-on: https://gerrit.chromium.org/gerrit/24261
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Gary Morain <gmorain@chromium.org>
diff --git a/shill_daemon.h b/shill_daemon.h
index a0174ea..a03bf2c 100644
--- a/shill_daemon.h
+++ b/shill_daemon.h
@@ -20,6 +20,7 @@
 class Config;
 class ControlInterface;
 class DHCPProvider;
+class Error;
 class GLib;
 class NSS;
 class ProxyFactory;
@@ -36,11 +37,20 @@
   void SetStartupPortalList(const std::string &portal_list);
   // Main for connection manager.  Starts main process and holds event loop.
   void Run();
+
+  // Starts the termination actions in the manager.
   void Quit();
 
  private:
   friend class ShillDaemonTest;
 
+  // Time to wait for termination actions to complete.
+  static const int kTerminationActionsTimeout;  // ms
+
+  // Causes the dispatcher message loop to terminate, calls Stop(), and returns
+  // to the main function which started the daemon.  Called when the termination
+  // actions are completed.
+  void TerminationActionsCompleted(const Error &error);
   void Start();
   void Stop();