Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 "dbus/object_proxy.h" | 5 #include "dbus/object_proxy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 564 const base::StringPiece& error_message) const { | 564 const base::StringPiece& error_message) const { |
| 565 if (ignore_service_unknown_errors_ && | 565 if (ignore_service_unknown_errors_ && |
| 566 (error_name == kErrorServiceUnknown || error_name == kErrorObjectUnknown)) | 566 (error_name == kErrorServiceUnknown || error_name == kErrorObjectUnknown)) |
| 567 return; | 567 return; |
| 568 logging::LogSeverity severity = logging::LOG_ERROR; | 568 logging::LogSeverity severity = logging::LOG_ERROR; |
| 569 // "UnknownObject" indicates that an object or service is no longer available, | 569 // "UnknownObject" indicates that an object or service is no longer available, |
| 570 // e.g. a Shill network service has gone out of range. Treat these as warnings | 570 // e.g. a Shill network service has gone out of range. Treat these as warnings |
| 571 // not errors. | 571 // not errors. |
| 572 if (error_name == kErrorObjectUnknown) | 572 if (error_name == kErrorObjectUnknown) |
| 573 severity = logging::LOG_WARNING; | 573 severity = logging::LOG_WARNING; |
| 574 std::ostringstream msg; | 574 LOG_AT_LEVEL(severity) << "Failed to call method: " << interface_name << "." |
|
danakj
2016/01/19 21:10:19
How about we delete the method in base and just ma
jbroman
2016/01/19 21:28:11
Done.
| |
| 575 msg << "Failed to call method: " << interface_name << "." << method_name | 575 << method_name |
| 576 << ": object_path= " << object_path_.value() | 576 << ": object_path= " << object_path_.value() << ": " |
| 577 << ": " << error_name << ": " << error_message; | 577 << error_name << ": " << error_message; |
| 578 logging::LogAtLevel(severity, msg.str()); | |
| 579 } | 578 } |
| 580 | 579 |
| 581 void ObjectProxy::OnCallMethodError(const std::string& interface_name, | 580 void ObjectProxy::OnCallMethodError(const std::string& interface_name, |
| 582 const std::string& method_name, | 581 const std::string& method_name, |
| 583 ResponseCallback response_callback, | 582 ResponseCallback response_callback, |
| 584 ErrorResponse* error_response) { | 583 ErrorResponse* error_response) { |
| 585 if (error_response) { | 584 if (error_response) { |
| 586 // Error message may contain the error message as string. | 585 // Error message may contain the error message as string. |
| 587 MessageReader reader(error_response); | 586 MessageReader reader(error_response); |
| 588 std::string error_message; | 587 std::string error_message; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 703 bool service_is_available) { | 702 bool service_is_available) { |
| 704 bus_->AssertOnOriginThread(); | 703 bus_->AssertOnOriginThread(); |
| 705 | 704 |
| 706 std::vector<WaitForServiceToBeAvailableCallback> callbacks; | 705 std::vector<WaitForServiceToBeAvailableCallback> callbacks; |
| 707 callbacks.swap(wait_for_service_to_be_available_callbacks_); | 706 callbacks.swap(wait_for_service_to_be_available_callbacks_); |
| 708 for (size_t i = 0; i < callbacks.size(); ++i) | 707 for (size_t i = 0; i < callbacks.size(); ++i) |
| 709 callbacks[i].Run(service_is_available); | 708 callbacks[i].Run(service_is_available); |
| 710 } | 709 } |
| 711 | 710 |
| 712 } // namespace dbus | 711 } // namespace dbus |
| OLD | NEW |