chromium/dbus/bus.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "dbus/bus.h"

#include <stddef.h>

#include <memory>

#include "base/containers/contains.h"
#include "base/files/file_descriptor_watcher_posix.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/sequenced_task_runner.h"
#include "base/threading/scoped_blocking_call.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
#include "dbus/error.h"
#include "dbus/exported_object.h"
#include "dbus/message.h"
#include "dbus/object_manager.h"
#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
#include "dbus/scoped_dbus_error.h"

namespace dbus {

namespace {

const char kDisconnectedSignal[] =;
const char kDisconnectedMatchRule[] =;

// The NameOwnerChanged member in org.freedesktop.DBus
const char kNameOwnerChangedSignal[] =;

// The match rule used to filter for changes to a given service name owner.
const char kServiceNameOwnerChangeMatchRule[] =;

// The class is used for watching the file descriptor used for D-Bus
// communication.
class Watch {};

// The class is used for monitoring the timeout used for D-Bus method
// calls.
class Timeout {};

// Converts DBusError into dbus::Error.
Error ToError(const internal::ScopedDBusError& error) {}

}  // namespace

Bus::Options::Options()
  :{}

Bus::Options::~Options() = default;

Bus::Options::Options(Bus::Options&&) = default;

Bus::Options& Bus::Options::operator=(Bus::Options&&) = default;

Bus::Bus(const Options& options)
    :{}

Bus::~Bus() {}

ObjectProxy* Bus::GetObjectProxy(const std::string& service_name,
                                 const ObjectPath& object_path) {}

ObjectProxy* Bus::GetObjectProxyWithOptions(const std::string& service_name,
                                            const ObjectPath& object_path,
                                            int options) {}

bool Bus::RemoveObjectProxy(const std::string& service_name,
                            const ObjectPath& object_path,
                            base::OnceClosure callback) {}

bool Bus::RemoveObjectProxyWithOptions(const std::string& service_name,
                                       const ObjectPath& object_path,
                                       int options,
                                       base::OnceClosure callback) {}

void Bus::RemoveObjectProxyInternal(scoped_refptr<ObjectProxy> object_proxy,
                                    base::OnceClosure callback) {}

ExportedObject* Bus::GetExportedObject(const ObjectPath& object_path) {}

void Bus::UnregisterExportedObject(const ObjectPath& object_path) {}

void Bus::UnregisterExportedObjectInternal(
    scoped_refptr<ExportedObject> exported_object) {}

ObjectManager* Bus::GetObjectManager(const std::string& service_name,
                                     const ObjectPath& object_path) {}

bool Bus::RemoveObjectManager(const std::string& service_name,
                              const ObjectPath& object_path,
                              base::OnceClosure callback) {}

void Bus::RemoveObjectManagerInternal(
    scoped_refptr<dbus::ObjectManager> object_manager,
    base::OnceClosure callback) {}

void Bus::RemoveObjectManagerInternalHelper(
    scoped_refptr<dbus::ObjectManager> object_manager,
    base::OnceClosure callback) {}

bool Bus::Connect() {}

void Bus::ClosePrivateConnection() {}

void Bus::ShutdownAndBlock() {}

void Bus::ShutdownOnDBusThreadAndBlock() {}

void Bus::RequestOwnership(const std::string& service_name,
                           ServiceOwnershipOptions options,
                           OnOwnershipCallback on_ownership_callback) {}

void Bus::RequestOwnershipInternal(const std::string& service_name,
                                   ServiceOwnershipOptions options,
                                   OnOwnershipCallback on_ownership_callback) {}

bool Bus::RequestOwnershipAndBlock(const std::string& service_name,
                                   ServiceOwnershipOptions options) {}

bool Bus::ReleaseOwnership(const std::string& service_name) {}

bool Bus::SetUpAsyncOperations() {}

base::expected<std::unique_ptr<Response>, Error> Bus::SendWithReplyAndBlock(
    DBusMessage* request,
    int timeout_ms) {}

void Bus::SendWithReply(DBusMessage* request,
                        DBusPendingCall** pending_call,
                        int timeout_ms) {}

void Bus::Send(DBusMessage* request, uint32_t* serial) {}

void Bus::AddFilterFunction(DBusHandleMessageFunction filter_function,
                            void* user_data) {}

void Bus::RemoveFilterFunction(DBusHandleMessageFunction filter_function,
                               void* user_data) {}

void Bus::AddMatch(const std::string& match_rule, Error* error) {}

bool Bus::RemoveMatch(const std::string& match_rule, Error* error) {}

bool Bus::TryRegisterObjectPath(const ObjectPath& object_path,
                                const DBusObjectPathVTable* vtable,
                                void* user_data,
                                Error* error) {}

bool Bus::TryRegisterFallback(const ObjectPath& object_path,
                              const DBusObjectPathVTable* vtable,
                              void* user_data,
                              Error* error) {}

bool Bus::TryRegisterObjectPathInternal(
    const ObjectPath& object_path,
    const DBusObjectPathVTable* vtable,
    void* user_data,
    Error* error,
    TryRegisterObjectPathFunction* register_function) {}

void Bus::UnregisterObjectPath(const ObjectPath& object_path) {}

void Bus::ShutdownOnDBusThreadAndBlockInternal() {}

void Bus::ProcessAllIncomingDataIfAny() {}

base::SequencedTaskRunner* Bus::GetDBusTaskRunner() {}

base::SequencedTaskRunner* Bus::GetOriginTaskRunner() {}

bool Bus::HasDBusThread() {}

void Bus::AssertOnOriginThread() {}

void Bus::AssertOnDBusThread() {}

std::string Bus::GetServiceOwnerAndBlock(const std::string& service_name,
                                         GetServiceOwnerOption options) {}

void Bus::GetServiceOwner(const std::string& service_name,
                          GetServiceOwnerCallback callback) {}

void Bus::GetServiceOwnerInternal(const std::string& service_name,
                                  GetServiceOwnerCallback callback) {}

void Bus::ListenForServiceOwnerChange(
    const std::string& service_name,
    const ServiceOwnerChangeCallback& callback) {}

void Bus::ListenForServiceOwnerChangeInternal(
    const std::string& service_name,
    const ServiceOwnerChangeCallback& callback) {}

void Bus::UnlistenForServiceOwnerChange(
    const std::string& service_name,
    const ServiceOwnerChangeCallback& callback) {}

void Bus::UnlistenForServiceOwnerChangeInternal(
    const std::string& service_name,
    const ServiceOwnerChangeCallback& callback) {}

std::string Bus::GetConnectionName() {}

bool Bus::IsConnected() {}

dbus_bool_t Bus::OnAddWatch(DBusWatch* raw_watch) {}

void Bus::OnRemoveWatch(DBusWatch* raw_watch) {}

void Bus::OnToggleWatch(DBusWatch* raw_watch) {}

dbus_bool_t Bus::OnAddTimeout(DBusTimeout* raw_timeout) {}

void Bus::OnRemoveTimeout(DBusTimeout* raw_timeout) {}

void Bus::OnToggleTimeout(DBusTimeout* raw_timeout) {}

void Bus::OnDispatchStatusChanged(DBusConnection* connection,
                                  DBusDispatchStatus status) {}

void Bus::OnServiceOwnerChanged(DBusMessage* message) {}

// static
dbus_bool_t Bus::OnAddWatchThunk(DBusWatch* raw_watch, void* data) {}

// static
void Bus::OnRemoveWatchThunk(DBusWatch* raw_watch, void* data) {}

// static
void Bus::OnToggleWatchThunk(DBusWatch* raw_watch, void* data) {}

// static
dbus_bool_t Bus::OnAddTimeoutThunk(DBusTimeout* raw_timeout, void* data) {}

// static
void Bus::OnRemoveTimeoutThunk(DBusTimeout* raw_timeout, void* data) {}

// static
void Bus::OnToggleTimeoutThunk(DBusTimeout* raw_timeout, void* data) {}

// static
void Bus::OnDispatchStatusChangedThunk(DBusConnection* connection,
                                       DBusDispatchStatus status,
                                       void* data) {}

// static
DBusHandlerResult Bus::OnConnectionDisconnectedFilter(
    DBusConnection* connection,
    DBusMessage* message,
    void* data) {}

// static
DBusHandlerResult Bus::OnServiceOwnerChangedFilter(
    DBusConnection* connection,
    DBusMessage* message,
    void* data) {}

}  // namespace dbus