blob: b4e12d3dfaa87038dddd95dfe46f96d0813409e0 [file] [log] [blame]
Alex Vakulenkofa8f9442014-08-27 14:50:36 -07001// Copyright 2014 The Chromium OS 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.
4
5#include <chromeos/dbus/dbus_signal.h>
6
7#include <chromeos/dbus/dbus_object.h>
8
9namespace chromeos {
10namespace dbus_utils {
11
12DBusSignalBase::DBusSignalBase(DBusObject* dbus_object,
13 const std::string& interface_name,
14 const std::string& signal_name)
Alex Vakulenko05d29042015-01-13 09:39:25 -080015 : interface_name_(interface_name),
16 signal_name_(signal_name),
17 dbus_object_(dbus_object) {
Alex Vakulenkofa8f9442014-08-27 14:50:36 -070018}
19
20bool DBusSignalBase::SendSignal(dbus::Signal* signal) const {
21 // This sends the signal asynchronously. However, the raw message inside
22 // the signal object is ref-counted, so we're fine to pass a stack-allocated
23 // Signal object here.
24 return dbus_object_->SendSignal(signal);
25}
26
27} // namespace dbus_utils
28} // namespace chromeos