shill: make fewer request_name calls

Prior to this CL, we were making a request_name call every
time we instantiated a D-Bus adaptor. For example, we'd
call request_name every time a service was created.

Each request_name call, in turn, leads to a add_match call.
(To listen for messages sent to that name.) Eventually, we
exhaust dbus-daemon's limit on the number of match rules
for a single process. (The limit seems to be ~500.)

Note that we hit this limit even without 500 _simultaneous_
services, because destroying a service doesn't remove the
match rule. (The rule isn't created in the service ctor,
but rather, in CreateServiceAdaptor. And we have no
analogue for releasing a service adaptor.)

We could resolve the matter by arranging to remove match
rules when a service goes away. However, noting that all
the request_name calls ask for ownership of the same, a
simpler solution is possible. Namely, request the name once
(in Init), rather than every time an adaptor is created.

BUG=chromium-os:27339
TEST=WiFiManager, unit tests, manual

Manual test: enable/disable WiFi many times in a loop,
so that WiFi continutally instantiates and destroys
services. Before this CL, shill crashes when instantiating
the 500-th (or so) service. With the CL, shill continues
to run after instantiating its 2900-th service.

Note that https://gerrit.chromium.org/gerrit/#change,18123
was applied to facilitate manual testing (the CL provides
enable/disable support).

Change-Id: I032d8c57b3a120cecd51c02a98388bb22bb3b644
Reviewed-on: https://gerrit.chromium.org/gerrit/18185
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/rpc_task_dbus_adaptor.cc b/rpc_task_dbus_adaptor.cc
index 42364c4..4f9f67c 100644
--- a/rpc_task_dbus_adaptor.cc
+++ b/rpc_task_dbus_adaptor.cc
@@ -15,14 +15,12 @@
 namespace shill {
 
 // static
-const char RPCTaskDBusAdaptor::kInterfaceName[] = SHILL_INTERFACE;
-// static
 const char RPCTaskDBusAdaptor::kPath[] = "/task/";
 
 RPCTaskDBusAdaptor::RPCTaskDBusAdaptor(DBus::Connection *conn, RPCTask *task)
     : DBusAdaptor(conn, kPath + task->UniqueName()),
       task_(task),
-      interface_name_(string(kInterfaceName) + ".Task"),
+      interface_name_(SHILL_INTERFACE ".Task"),
       connection_name_(conn->unique_name()) {}
 
 RPCTaskDBusAdaptor::~RPCTaskDBusAdaptor() {