Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Side by Side Diff: dbus/scoped_dbus_error.h

Issue 592793004: Move inline som functions ScopedDBusError into a .cc file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a link-time issue of methods not being exported Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dbus/dbus.gyp ('k') | dbus/scoped_dbus_error.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DBUS_SCOPED_DBUS_ERROR_H_ 5 #ifndef DBUS_SCOPED_DBUS_ERROR_H_
6 #define DBUS_SCOPED_DBUS_ERROR_H_ 6 #define DBUS_SCOPED_DBUS_ERROR_H_
7 7
8 #include <dbus/dbus.h> 8 #include <dbus/dbus.h>
9 9
10 #include "dbus/dbus_export.h"
11
10 namespace dbus { 12 namespace dbus {
11 13
12 // Utility class to ensure that DBusError is freed. 14 // Utility class to ensure that DBusError is freed.
13 class ScopedDBusError { 15 class CHROME_DBUS_EXPORT ScopedDBusError {
14 public: 16 public:
15 ScopedDBusError() { 17 // Do not inline methods that call dbus_error_xxx() functions.
16 dbus_error_init(&error_); 18 // See http://crbug.com/416628
17 } 19 ScopedDBusError();
18 20 ~ScopedDBusError();
19 ~ScopedDBusError() {
20 dbus_error_free(&error_);
21 }
22 21
23 DBusError* get() { return &error_; } 22 DBusError* get() { return &error_; }
24 bool is_set() const { return dbus_error_is_set(&error_); } 23 bool is_set() const;
25 const char* name() { return error_.name; } 24 const char* name() { return error_.name; }
26 const char* message() { return error_.message; } 25 const char* message() { return error_.message; }
27 26
28 private: 27 private:
29 DBusError error_; 28 DBusError error_;
30 }; 29 };
31 30
32 } // namespace dbus 31 } // namespace dbus
33 32
34 #endif // DBUS_SCOPED_DBUS_ERROR_H_ 33 #endif // DBUS_SCOPED_DBUS_ERROR_H_
OLDNEW
« no previous file with comments | « dbus/dbus.gyp ('k') | dbus/scoped_dbus_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698