| OLD | NEW |
| 1 // Copyright (c) 2010, 2011 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010, 2011 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/service_manager_impl.h" | 5 #include "src/service_manager_impl.h" |
| 6 | 6 |
| 7 #include <glog/logging.h> | 7 #include <glog/logging.h> |
| 8 | 8 |
| 9 #include "src/cashew_server.h" | 9 #include "src/cashew_server.h" |
| 10 #include "src/service.h" | 10 #include "src/service.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 void ServiceManagerImpl::EmitDataPlansUpdate(const Service& service) { | 159 void ServiceManagerImpl::EmitDataPlansUpdate(const Service& service) { |
| 160 DLOG(INFO) << "EmitDataPlansUpdate: service = " << service.GetPath(); | 160 DLOG(INFO) << "EmitDataPlansUpdate: service = " << service.GetPath(); |
| 161 if (cashew_server_ == NULL) { | 161 if (cashew_server_ == NULL) { |
| 162 DLOG(WARNING) << "EmitDataPlansUpdate: no Cashew server"; | 162 DLOG(WARNING) << "EmitDataPlansUpdate: no Cashew server"; |
| 163 return; | 163 return; |
| 164 } | 164 } |
| 165 cashew_server_->EmitDataPlansUpdate(service); | 165 cashew_server_->EmitDataPlansUpdate(service); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void ServiceManagerImpl::OnDataPlanInactive(const Service& service, |
| 169 const DataPlan& plan) { |
| 170 DLOG(INFO) << "OnDataPlanInactive: service = " << service.GetPath() |
| 171 << ", plan = " << plan.GetName(); |
| 172 DCHECK(!plan.IsActive()); |
| 173 // TODO(vlaviano): hook for future use |
| 174 // we could emit a PlanExpired D-Bus signal for Chrome to consume |
| 175 } |
| 176 |
| 168 // Private methods | 177 // Private methods |
| 169 | 178 |
| 170 void ServiceManagerImpl::DeleteServices(ServiceMap *service_map) { | 179 void ServiceManagerImpl::DeleteServices(ServiceMap *service_map) { |
| 171 DCHECK(service_map != NULL); | 180 DCHECK(service_map != NULL); |
| 172 while (!service_map->empty()) { | 181 while (!service_map->empty()) { |
| 173 const std::string& path = | 182 const std::string& path = |
| 174 static_cast<std::string>(service_map->begin()->first); | 183 static_cast<std::string>(service_map->begin()->first); |
| 175 DLOG(INFO) << "DeleteServices: deleting service: " << path; | 184 DLOG(INFO) << "DeleteServices: deleting service: " << path; |
| 176 Service *service = static_cast<Service *>(service_map->begin()->second); | 185 Service *service = static_cast<Service *>(service_map->begin()->second); |
| 177 DCHECK(service != NULL); | 186 DCHECK(service != NULL); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 // notify our child services | 453 // notify our child services |
| 445 ServiceMap::iterator it; | 454 ServiceMap::iterator it; |
| 446 for (it = services_.begin(); it != services_.end(); ++it) { | 455 for (it = services_.begin(); it != services_.end(); ++it) { |
| 447 Service *service = static_cast<Service*>(it->second); | 456 Service *service = static_cast<Service*>(it->second); |
| 448 DCHECK(service != NULL); | 457 DCHECK(service != NULL); |
| 449 service->OnFlimflamOffline(); | 458 service->OnFlimflamOffline(); |
| 450 } | 459 } |
| 451 } | 460 } |
| 452 | 461 |
| 453 } // namespace cashew | 462 } // namespace cashew |
| OLD | NEW |