shill: wifi: Disable or reduce frequency of background scan.

For details, see corresponding flimflam patch:

https://gerrit.chromium.org/gerrit/#change,24960

Also, rename per style and fix a bug in NumEndpoints (returning bool
rather than an int) and add more unit tests.

BUG=chromium-os:31715
TEST=unit tests

Change-Id: I9b0c6f1abc660a44a43f34b1dec2230c6cf6cfde
Reviewed-on: https://gerrit.chromium.org/gerrit/25376
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/wifi_service.cc b/wifi_service.cc
index 0afa2e5..a6eafdd 100644
--- a/wifi_service.cc
+++ b/wifi_service.cc
@@ -175,13 +175,13 @@
   return wifi_->IsConnectingTo(*this);
 }
 
-void WiFiService::AddEndpoint(const WiFiEndpointConstRefPtr endpoint) {
+void WiFiService::AddEndpoint(const WiFiEndpointConstRefPtr &endpoint) {
   DCHECK(endpoint->ssid() == ssid());
   endpoints_.insert(endpoint);
   UpdateFromEndpoints();
 }
 
-void WiFiService::RemoveEndpoint(const WiFiEndpointConstRefPtr endpoint) {
+void WiFiService::RemoveEndpoint(const WiFiEndpointConstRefPtr &endpoint) {
   set<WiFiEndpointConstRefPtr>::iterator i = endpoints_.find(endpoint);
   DCHECK(i != endpoints_.end());
   if (i == endpoints_.end()) {