Commit 7c5b40c1 authored by avakulenko's avatar avakulenko Committed by Commit bot

Move inline som functions ScopedDBusError into a .cc file

dbus::ScopedDBusError has inline constructor/destructor and
is_set() method that call into libdbus-1. By placing these
function calls in a header file, we add implicit link dependency
on components that need to use ScopedDBusError. If we move
them out to a .cc file, the dependency will be localized to
libchrome.

BUG=chromium:416628
TEST=dbus_unittests pass

Review URL: https://codereview.chromium.org/592793004

Cr-Commit-Position: refs/heads/master@{#296478}
parent f35425b2
......@@ -25,6 +25,7 @@ component("dbus") {
"object_proxy.h",
"property.cc",
"property.h",
"scoped_dbus_error.cc",
"scoped_dbus_error.h",
"string_util.cc",
"string_util.h",
......
......@@ -41,6 +41,7 @@
'object_proxy.h',
'property.cc',
'property.h',
'scoped_dbus_error.cc',
'scoped_dbus_error.h',
'string_util.cc',
'string_util.h',
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "dbus/scoped_dbus_error.h"
namespace dbus {
ScopedDBusError::ScopedDBusError() {
dbus_error_init(&error_);
}
ScopedDBusError::~ScopedDBusError() {
dbus_error_free(&error_);
}
bool ScopedDBusError::is_set() const {
return dbus_error_is_set(&error_);
}
} // namespace dbus
......@@ -7,21 +7,20 @@
#include <dbus/dbus.h>
#include "dbus/dbus_export.h"
namespace dbus {
// Utility class to ensure that DBusError is freed.
class ScopedDBusError {
class CHROME_DBUS_EXPORT ScopedDBusError {
public:
ScopedDBusError() {
dbus_error_init(&error_);
}
~ScopedDBusError() {
dbus_error_free(&error_);
}
// Do not inline methods that call dbus_error_xxx() functions.
// See http://crbug.com/416628
ScopedDBusError();
~ScopedDBusError();
DBusError* get() { return &error_; }
bool is_set() const { return dbus_error_is_set(&error_); }
bool is_set() const;
const char* name() { return error_.name; }
const char* message() { return error_.message; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment