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/bus.h" | 5 #include "dbus/bus.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 487 |
488 void ObjectProxy::LogMethodCallFailure( | 488 void ObjectProxy::LogMethodCallFailure( |
489 const base::StringPiece& interface_name, | 489 const base::StringPiece& interface_name, |
490 const base::StringPiece& method_name, | 490 const base::StringPiece& method_name, |
491 const base::StringPiece& error_name, | 491 const base::StringPiece& error_name, |
492 const base::StringPiece& error_message) const { | 492 const base::StringPiece& error_message) const { |
493 if (ignore_service_unknown_errors_ && error_name == kErrorServiceUnknown) | 493 if (ignore_service_unknown_errors_ && error_name == kErrorServiceUnknown) |
494 return; | 494 return; |
495 LOG(ERROR) << "Failed to call method: " | 495 LOG(ERROR) << "Failed to call method: " |
496 << interface_name << "." << method_name | 496 << interface_name << "." << method_name |
| 497 << ": object_path= " << object_path_.value() |
497 << ": " << error_name << ": " << error_message; | 498 << ": " << error_name << ": " << error_message; |
498 } | 499 } |
499 | 500 |
500 void ObjectProxy::OnCallMethodError(const std::string& interface_name, | 501 void ObjectProxy::OnCallMethodError(const std::string& interface_name, |
501 const std::string& method_name, | 502 const std::string& method_name, |
502 ResponseCallback response_callback, | 503 ResponseCallback response_callback, |
503 ErrorResponse* error_response) { | 504 ErrorResponse* error_response) { |
504 if (error_response) { | 505 if (error_response) { |
505 // Error message may contain the error message as string. | 506 // Error message may contain the error message as string. |
506 dbus::MessageReader reader(error_response); | 507 dbus::MessageReader reader(error_response); |
507 std::string error_message; | 508 std::string error_message; |
508 reader.PopString(&error_message); | 509 reader.PopString(&error_message); |
509 LogMethodCallFailure(interface_name, | 510 LogMethodCallFailure(interface_name, |
510 method_name, | 511 method_name, |
511 error_response->GetErrorName(), | 512 error_response->GetErrorName(), |
512 error_message); | 513 error_message); |
513 } | 514 } |
514 response_callback.Run(NULL); | 515 response_callback.Run(NULL); |
515 } | 516 } |
516 | 517 |
517 } // namespace dbus | 518 } // namespace dbus |
OLD | NEW |