Alex Vakulenko | fa8f944 | 2014-08-27 14:50:36 -0700 | [diff] [blame] | 1 | // 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 | |
| 9 | namespace chromeos { |
| 10 | namespace dbus_utils { |
| 11 | |
| 12 | DBusSignalBase::DBusSignalBase(DBusObject* dbus_object, |
| 13 | const std::string& interface_name, |
| 14 | const std::string& signal_name) |
Alex Vakulenko | 05d2904 | 2015-01-13 09:39:25 -0800 | [diff] [blame] | 15 | : interface_name_(interface_name), |
| 16 | signal_name_(signal_name), |
| 17 | dbus_object_(dbus_object) { |
Alex Vakulenko | fa8f944 | 2014-08-27 14:50:36 -0700 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | bool 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 |