#include "base/strings/string_piece.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
+#include "base/types/expected.h"
#include "dbus/dbus_export.h"
+#include "dbus/error.h"
#include "dbus/object_path.h"
namespace dbus {
class ErrorResponse;
class MethodCall;
class Response;
-class ScopedDBusError;
class Signal;
// ObjectProxy is used to communicate with remote objects, mainly for
base::OnceCallback<void(const std::string&, const std::string&, bool)>;
// Calls the method of the remote object and blocks until the response
- // is returned. Returns NULL on error with the error details specified
- // in the |error| object.
+ // is returned.
//
- // BLOCKING CALL.
- virtual std::unique_ptr<Response> CallMethodAndBlockWithErrorDetails(
- MethodCall* method_call,
- int timeout_ms,
- ScopedDBusError* error);
-
- // Calls the method of the remote object and blocks until the response
- // is returned. Returns NULL on error.
+ // If this is failing due to the reason outside of libdbus, this may return
+ // an invalid error to indicate the situation.
+ // This must be called on D-Bus thread.
//
// BLOCKING CALL.
- virtual std::unique_ptr<Response> CallMethodAndBlock(MethodCall* method_call,
- int timeout_ms);
+ virtual base::expected<std::unique_ptr<Response>, Error> CallMethodAndBlock(
+ MethodCall* method_call,
+ int timeout_ms);
// Requests to call the method of the remote object.
//