diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-26 20:12:21 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-26 20:12:21 +0000 |
commit | eb052c93fa488df29314bcb70bb2458982fc94c8 (patch) | |
tree | 3bb1a9476dfb9b3bf4b21deb98ac1df68a8245cd /chromeos/network/shill_property_handler.cc | |
parent | 7b5f89c4c97cd2ce098155b91018aca58d0e8b6d (diff) | |
download | chromium_src-eb052c93fa488df29314bcb70bb2458982fc94c8.zip chromium_src-eb052c93fa488df29314bcb70bb2458982fc94c8.tar.gz chromium_src-eb052c93fa488df29314bcb70bb2458982fc94c8.tar.bz2 |
Add network_handler_callbacks.cc
This does some cleanup to allow NetworkStateHandler to use the same error callback infrastructure as NetworkConfigurationHandler.
It also adds event logging for errors.
BUG=none
Review URL: https://codereview.chromium.org/11416149
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/network/shill_property_handler.cc')
-rw-r--r-- | chromeos/network/shill_property_handler.cc | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/chromeos/network/shill_property_handler.cc b/chromeos/network/shill_property_handler.cc index 2fe6f99..ec9331b 100644 --- a/chromeos/network/shill_property_handler.cc +++ b/chromeos/network/shill_property_handler.cc @@ -28,12 +28,6 @@ const char kLogModule[] = "ShillPropertyHandler"; // order, it should be reasonable to ignore services past this. const size_t kMaxObservedServices = 100; -void ErrorCallbackFunction(const std::string& error_name, - const std::string& error_message) { - // TODO(stevenjb): Add error logging. - LOG(ERROR) << "Shill Error: " << error_name << " : " << error_message; -} - const base::ListValue* GetListValue(const std::string& key, const base::Value& value) { const base::ListValue* vlist = NULL; @@ -72,22 +66,29 @@ void ShillPropertyHandler::Init() { void ShillPropertyHandler::SetTechnologyEnabled( const std::string& technology, - bool enabled) { + bool enabled, + const network_handler::ErrorCallback& error_callback) { if (enabled) { - shill_manager_->EnableTechnology(technology, - base::Bind(&base::DoNothing), - base::Bind(&ErrorCallbackFunction)); + shill_manager_->EnableTechnology( + technology, + base::Bind(&base::DoNothing), + base::Bind(&network_handler::ShillErrorCallbackFunction, + kLogModule, technology, error_callback)); } else { - shill_manager_->DisableTechnology(technology, - base::Bind(&base::DoNothing), - base::Bind(&ErrorCallbackFunction)); + shill_manager_->DisableTechnology( + technology, + base::Bind(&base::DoNothing), + base::Bind(&network_handler::ShillErrorCallbackFunction, + kLogModule, technology, error_callback)); } } void ShillPropertyHandler::RequestScan() const { - shill_manager_->RequestScan("", - base::Bind(&base::DoNothing), - base::Bind(&ErrorCallbackFunction)); + shill_manager_->RequestScan( + "", + base::Bind(&base::DoNothing), + base::Bind(&network_handler::ShillErrorCallbackFunction, + kLogModule, "", network_handler::ErrorCallback())); } void ShillPropertyHandler::RequestProperties(ManagedState::ManagedType type, |