chaps: assure that we get the D-Bus name we want

The old DBus::Connection::request_name method doesn't necessarily
succeed, and it doesn't tell us when it fails. This means that
chaps might keep running, even though no one can talk to it over
D-Bus.

Switch to the new acquire_name method, which actually reports
whether or not we got the name we asked for. Abort if we didn't
get the name, so that a useless process doesn't stick around.

BUG=chromium:364548
TEST=unit tests

Change-Id: I04c0777e757c2a52f49dcc807a45a49803a5e165
Reviewed-on: https://chromium-review.googlesource.com/197066
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
diff --git a/chaps_adaptor.cc b/chaps_adaptor.cc
index 27fc926..3852563 100644
--- a/chaps_adaptor.cc
+++ b/chaps_adaptor.cc
@@ -25,7 +25,7 @@
 // Helper used when calling the ObjectAdaptor constructor.
 static DBus::Connection& GetConnection() {
   static DBus::Connection connection = DBus::Connection::SystemBus();
-  connection.request_name(kChapsServiceName);
+  CHECK(connection.acquire_name(kChapsServiceName));
   return connection;
 }