1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef DBUS_SCOPED_DBUS_ERROR_H_
6 #define DBUS_SCOPED_DBUS_ERROR_H_
10 namespace dbus::internal {
12 // Utility class to ensure that DBusError is freed.
13 class ScopedDBusError {
15 // Do not inline methods that call dbus_error_xxx() functions.
16 // See http://crbug.com/416628
20 DBusError* get() { return &error_; }
22 const char* name() const { return error_.name; }
23 const char* message() const { return error_.message; }
29 } // namespace dbus::internal
31 #endif // DBUS_SCOPED_DBUS_ERROR_H_