Cleanup DBus interface.

Prior to importing the DBus interface into the Policy Manager, this
removes some clutter and fixes some behaviors.

* Switch from using dbus_g_proxy_new_for_name_owner() to using
  dbus_g_proxy_new_for_name() instead. This has been advised in the past
  (see chromium:209102) as the _owner version is mostly used for binding
  to interfaces that do not retain the well-known name. It is not
  appropriate for our use cases, where the provider inhibits the
  well-known location constantly, nor is it a good thing given that
  providers (e.g. Chrome) could get recycled.

* More consistent abstraction for variadic DBus functions: (a) We now
  distinguish between different numbers of input/output arguments by
  appending these numbers to the names of interface functions (e.g.
  ProxyCall_3_0 delegates 3 input arguments and zero outputs);  (b) We
  drop G_TYPE arguments and embed them as constants in the delegating
  code. This makes more sense because these types are constants and
  depend on the actual values, which are bound to predetermined C/C++
  types anyway;  (c) It is still possible to override such functions by
  variating the types of actual arguments (currently not exercised).

* The above also shortens the argument list for several DBus interface
  functions, saving us from needing to prune them to fit in mock methods
  with a maximum of 10 arguments (as was previously necessary).

* Removed an unnecessary #include; better comments; more descriptive
  argument names.

Other notable changes in client code:

* Some cleaup in chrome_browser_proxy_resolver.cc, removing unnecessary
  functions and reverting the proxy reacquisition logic introduced in
  CL:15693, which is now redundant.

BUG=None
TEST=Unit tests.

Change-Id: I8063bb3e35c34212a8be1ae507834c931ee5a0b0
Reviewed-on: https://chromium-review.googlesource.com/188560
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/connection_manager_unittest.cc b/connection_manager_unittest.cc
index 3b88564..b8e8531 100644
--- a/connection_manager_unittest.cc
+++ b/connection_manager_unittest.cc
@@ -91,24 +91,17 @@
                       array_as_value);
 
   // Plumb return value into mock object.
-  EXPECT_CALL(dbus_iface_, ProxyCall(kMockFlimFlamManagerProxy_,
-                                     StrEq(kGetPropertiesMethod),
-                                     _,
-                                     G_TYPE_INVALID,
-                                     dbus_g_type_get_map("GHashTable",
-                                                         G_TYPE_STRING,
-                                                         G_TYPE_VALUE),
-                                     _,
-                                     G_TYPE_INVALID))
-      .WillOnce(DoAll(SetArgumentPointee<5>(manager_hash_table), Return(TRUE)));
+  EXPECT_CALL(dbus_iface_, ProxyCall_0_1(kMockFlimFlamManagerProxy_,
+                                         StrEq(kGetPropertiesMethod),
+                                         _, _))
+      .WillOnce(DoAll(SetArgumentPointee<3>(manager_hash_table), Return(TRUE)));
 
   // Set other expectations.
   EXPECT_CALL(dbus_iface_,
-              ProxyNewForNameOwner(kMockSystemBus_,
-                                   StrEq(shill::kFlimflamServiceName),
-                                   StrEq(shill::kFlimflamServicePath),
-                                   StrEq(shill::kFlimflamManagerInterface),
-                                   _))
+              ProxyNewForName(kMockSystemBus_,
+                              StrEq(shill::kFlimflamServiceName),
+                              StrEq(shill::kFlimflamServicePath),
+                              StrEq(shill::kFlimflamManagerInterface)))
       .WillOnce(Return(kMockFlimFlamManagerProxy_));
   EXPECT_CALL(dbus_iface_, ProxyUnref(kMockFlimFlamManagerProxy_));
   EXPECT_CALL(dbus_iface_, BusGet(DBUS_BUS_SYSTEM, _))
@@ -142,24 +135,17 @@
   }
 
   // Plumb return value into mock object.
-  EXPECT_CALL(dbus_iface_, ProxyCall(kMockFlimFlamServiceProxy_,
-                                    StrEq(kGetPropertiesMethod),
-                                    _,
-                                    G_TYPE_INVALID,
-                                    dbus_g_type_get_map("GHashTable",
-                                                        G_TYPE_STRING,
-                                                        G_TYPE_VALUE),
-                                    _,
-                                    G_TYPE_INVALID))
-      .WillOnce(DoAll(SetArgumentPointee<5>(service_hash_table), Return(TRUE)));
+  EXPECT_CALL(dbus_iface_, ProxyCall_0_1(kMockFlimFlamServiceProxy_,
+                                         StrEq(kGetPropertiesMethod),
+                                         _, _))
+      .WillOnce(DoAll(SetArgumentPointee<3>(service_hash_table), Return(TRUE)));
 
   // Set other expectations.
   EXPECT_CALL(dbus_iface_,
-      ProxyNewForNameOwner(kMockSystemBus_,
-                             StrEq(shill::kFlimflamServiceName),
-                             StrEq(kServicePath_),
-                             StrEq(shill::kFlimflamServiceInterface),
-                             _))
+              ProxyNewForName(kMockSystemBus_,
+                              StrEq(shill::kFlimflamServiceName),
+                              StrEq(kServicePath_),
+                              StrEq(shill::kFlimflamServiceInterface)))
       .WillOnce(Return(kMockFlimFlamServiceProxy_));
   EXPECT_CALL(dbus_iface_, ProxyUnref(kMockFlimFlamServiceProxy_));
   EXPECT_CALL(dbus_iface_, BusGet(DBUS_BUS_SYSTEM, _))