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/error.cc b/error.cc
index 28f7d28..a61f736 100644
--- a/error.cc
+++ b/error.cc
@@ -42,9 +42,6 @@
   { "PermissionDenied", "Permission denied" }
 };
 
-// static
-const char Error::kInterfaceName[] = SHILL_INTERFACE;
-
 Error::Error() {
   Reset();
 }
@@ -89,7 +86,7 @@
 // static
 string Error::GetName(Type type) {
   CHECK(type < kNumErrors) << "Error type out of range: " << type;
-  return base::StringPrintf("%s.Error.%s", kInterfaceName, kInfos[type].name);
+  return base::StringPrintf("%s.Error.%s", SHILL_INTERFACE, kInfos[type].name);
 }
 
 // static