[M120 Migration][VD] Fix url crash in RequestCertificateConfirm
[platform/framework/web/chromium-efl.git] / dbus / scoped_dbus_error.h
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.
4
5 #ifndef DBUS_SCOPED_DBUS_ERROR_H_
6 #define DBUS_SCOPED_DBUS_ERROR_H_
7
8 #include <dbus/dbus.h>
9
10 namespace dbus::internal {
11
12 // Utility class to ensure that DBusError is freed.
13 class ScopedDBusError {
14  public:
15   // Do not inline methods that call dbus_error_xxx() functions.
16   // See http://crbug.com/416628
17   ScopedDBusError();
18   ~ScopedDBusError();
19
20   DBusError* get() { return &error_; }
21   bool is_set() const;
22   const char* name() const { return error_.name; }
23   const char* message() const { return error_.message; }
24
25  private:
26   DBusError error_;
27 };
28
29 }  // namespace dbus::internal
30
31 #endif  // DBUS_SCOPED_DBUS_ERROR_H_