| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 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.h" | 5 #include "src/service.h" |
| 6 | 6 |
| 7 #include <glog/logging.h> | 7 #include <glog/logging.h> |
| 8 | 8 |
| 9 #include "src/data_plan_provider.h" | 9 #include "src/data_plan_provider.h" |
| 10 #include "src/device.h" | 10 #include "src/device.h" |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 void Service::OnUsageUrlUpdate(const std::string& usage_url) { | 428 void Service::OnUsageUrlUpdate(const std::string& usage_url) { |
| 429 DLOG(INFO) << path_ << ": OnUsageUrlUpdate: url = " << usage_url; | 429 DLOG(INFO) << path_ << ": OnUsageUrlUpdate: url = " << usage_url; |
| 430 if (usage_url == usage_url_) { | 430 if (usage_url == usage_url_) { |
| 431 return; | 431 return; |
| 432 } | 432 } |
| 433 usage_url_ = usage_url; | 433 usage_url_ = usage_url; |
| 434 if (provider_ != NULL) { | 434 if (provider_ != NULL) { |
| 435 DCHECK(usage_url != provider_->GetUsageUrl()); | 435 DCHECK(usage_url_ != provider_->GetUsageUrl()); |
| 436 StopSendingUsageRequests(); | 436 StopSendingUsageRequests(); |
| 437 provider_->SetUsageUrl(usage_url); | 437 provider_->SetUsageUrl(usage_url_); |
| 438 ReconsiderSendingUsageRequests(); | 438 ReconsiderSendingUsageRequests(); |
| 439 } | 439 } |
| 440 } | 440 } |
| 441 | 441 |
| 442 void Service::GetServiceProperties() { | 442 void Service::GetServiceProperties() { |
| 443 DLOG(INFO) << path_ << ": GetServiceProperties"; | 443 DLOG(INFO) << path_ << ": GetServiceProperties"; |
| 444 PropertyMap properties; | 444 PropertyMap properties; |
| 445 // dbus-c++ throws exceptions | 445 // dbus-c++ throws exceptions |
| 446 // invoke the "Existing Non-conformant Code" clause of the style guide and | 446 // invoke the "Existing Non-conformant Code" clause of the style guide and |
| 447 // isolate the rest of the system from this | 447 // isolate the rest of the system from this |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 void Service::ReconsiderSendingUsageRequests() { | 713 void Service::ReconsiderSendingUsageRequests() { |
| 714 DLOG(INFO) << path_ << ": ReconsiderSendingUsageRequests"; | 714 DLOG(INFO) << path_ << ": ReconsiderSendingUsageRequests"; |
| 715 if (!IsSendingUsageRequests() && ShouldSendUsageRequests()) { | 715 if (!IsSendingUsageRequests() && ShouldSendUsageRequests()) { |
| 716 StartSendingUsageRequests(); | 716 StartSendingUsageRequests(); |
| 717 } else if (IsSendingUsageRequests() && !ShouldSendUsageRequests()) { | 717 } else if (IsSendingUsageRequests() && !ShouldSendUsageRequests()) { |
| 718 StopSendingUsageRequests(); | 718 StopSendingUsageRequests(); |
| 719 } | 719 } |
| 720 } | 720 } |
| 721 | 721 |
| 722 } // namespace cashew | 722 } // namespace cashew |
| OLD | NEW |