Implement android_webview url intercepting.
[chromium-blink-merge.git] / dbus / scoped_dbus_error.h
blob67056477e5b3d6f7dcbdf7210dc0c5e3f257100b
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 namespace dbus {
12 // Utility class to ensure that DBusError is freed.
13 class ScopedDBusError {
14 public:
15 ScopedDBusError() {
16 dbus_error_init(&error_);
19 ~ScopedDBusError() {
20 dbus_error_free(&error_);
23 DBusError* get() { return &error_; }
24 bool is_set() { return dbus_error_is_set(&error_); }
25 const char* name() { return error_.name; }
26 const char* message() { return error_.message; }
28 private:
29 DBusError error_;
32 } // namespace dbus
34 #endif // DBUS_SCOPED_DBUS_ERROR_H_