Add support for multicast in PPB_UDPSocket API
[chromium-blink-merge.git] / dbus / scoped_dbus_error.h
blob1484dbb81b4b300dd6cd874287b07e7ff1b85271
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
3 // found in the LICENSE file.
5 #ifndef DBUS_SCOPED_DBUS_ERROR_H_
6 #define DBUS_SCOPED_DBUS_ERROR_H_
8 #include <dbus/dbus.h>
10 #include "dbus/dbus_export.h"
12 namespace dbus {
14 // Utility class to ensure that DBusError is freed.
15 class CHROME_DBUS_EXPORT ScopedDBusError {
16 public:
17 // Do not inline methods that call dbus_error_xxx() functions.
18 // See http://crbug.com/416628
19 ScopedDBusError();
20 ~ScopedDBusError();
22 DBusError* get() { return &error_; }
23 bool is_set() const;
24 const char* name() { return error_.name; }
25 const char* message() { return error_.message; }
27 private:
28 DBusError error_;
31 } // namespace dbus
33 #endif // DBUS_SCOPED_DBUS_ERROR_H_