diff options
author | Alex Vakulenko <avakulenko@google.com> | 2015-10-12 15:21:28 -0700 |
---|---|---|
committer | Alex Vakulenko <avakulenko@google.com> | 2015-10-13 16:10:03 -0700 |
commit | 9ed0cab99f18acb3570a35e9408f24355f6b8324 (patch) | |
tree | 60e3b4c2822b812b3218489a9a6d835df1e8ca6e /brillo/glib/abstract_dbus_service.cc | |
parent | eabfe23a51c91a103042793ac2d5c28170994e1f (diff) | |
download | libchromeos-9ed0cab99f18acb3570a35e9408f24355f6b8324.tar.gz |
Move chromeos symbols into brillo namespace
And move the include files into "brillo" directory instead of "chromeos"
BUG: 24872993
TEST=built aosp and brillo and unit tests pass on dragonoboard
Change-Id: Ieb979d1ebd3152921d36cd15acbd6247f02aae69
Diffstat (limited to 'brillo/glib/abstract_dbus_service.cc')
-rw-r--r-- | brillo/glib/abstract_dbus_service.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/brillo/glib/abstract_dbus_service.cc b/brillo/glib/abstract_dbus_service.cc new file mode 100644 index 0000000..c5ed27d --- /dev/null +++ b/brillo/glib/abstract_dbus_service.cc @@ -0,0 +1,36 @@ +// Copyright (c) 2010 The Chromium OS 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 <base/logging.h> + +#include "brillo/glib/abstract_dbus_service.h" + +namespace brillo { +namespace dbus { + +bool AbstractDbusService::Register(const brillo::dbus::BusConnection& conn) { + return RegisterExclusiveService(conn, + service_interface(), + service_name(), + service_path(), + service_object()); +} + +bool AbstractDbusService::Run() { + if (!main_loop()) { + LOG(ERROR) << "No run loop. Call Initialize before use."; + return false; + } + ::g_main_loop_run(main_loop()); + DLOG(INFO) << "Run() completed"; + return true; +} + +bool AbstractDbusService::Shutdown() { + ::g_main_loop_quit(main_loop()); + return true; +} + +} // namespace dbus +} // namespace brillo |