Home | History | Annotate | Download | only in dbus
      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 <brillo/dbus/dbus_signal.h>
      6 
      7 #include <brillo/dbus/dbus_object.h>
      8 
      9 namespace brillo {
     10 namespace dbus_utils {
     11 
     12 DBusSignalBase::DBusSignalBase(DBusObject* dbus_object,
     13                                const std::string& interface_name,
     14                                const std::string& signal_name)
     15     : interface_name_(interface_name),
     16       signal_name_(signal_name),
     17       dbus_object_(dbus_object) {
     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 brillo
     29