Skip to content

Commit

Permalink
Enhance the DBus interface for peerd
Browse files Browse the repository at this point in the history
Add ability to query properties of
 - Manager
 - Peer
 - Service
Add Observer to peerd so we are told when things change.

BUG=453873

Review URL: https://codereview.chromium.org/893663002

Cr-Commit-Position: refs/heads/master@{#315311}
  • Loading branch information
dtapuska authored and Commit bot committed Feb 9, 2015
1 parent b2e3ece commit 32d2545
Show file tree
Hide file tree
Showing 7 changed files with 634 additions and 36 deletions.
26 changes: 26 additions & 0 deletions chromeos/dbus/fake_peer_daemon_manager_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,32 @@ FakePeerDaemonManagerClient::~FakePeerDaemonManagerClient() {
void FakePeerDaemonManagerClient::Init(dbus::Bus* bus) {
}

void FakePeerDaemonManagerClient::AddObserver(Observer* observer) {
}

void FakePeerDaemonManagerClient::RemoveObserver(Observer* observer) {
}

std::vector<dbus::ObjectPath> FakePeerDaemonManagerClient::GetPeers() {
return std::vector<dbus::ObjectPath>();
}

std::vector<dbus::ObjectPath> FakePeerDaemonManagerClient::GetServices() {
return std::vector<dbus::ObjectPath>();
}

PeerDaemonManagerClient::PeerProperties*
FakePeerDaemonManagerClient::GetPeerProperties(
const dbus::ObjectPath& object_path) {
return nullptr;
}

PeerDaemonManagerClient::ServiceProperties*
FakePeerDaemonManagerClient::GetServiceProperties(
const dbus::ObjectPath& object_path) {
return nullptr;
}

void FakePeerDaemonManagerClient::StartMonitoring(
const std::vector<std::string>& requested_technologies,
const base::DictionaryValue& options,
Expand Down
8 changes: 8 additions & 0 deletions chromeos/dbus/fake_peer_daemon_manager_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ class FakePeerDaemonManagerClient : public PeerDaemonManagerClient {
void Init(dbus::Bus* bus) override;

// PeerDaemonManagerClient overrides:
void AddObserver(Observer* observer) override;
void RemoveObserver(Observer* observer) override;
std::vector<dbus::ObjectPath> GetPeers() override;
std::vector<dbus::ObjectPath> GetServices() override;
PeerProperties* GetPeerProperties(
const dbus::ObjectPath& object_path) override;
ServiceProperties* GetServiceProperties(
const dbus::ObjectPath& object_path) override;
void StartMonitoring(const std::vector<std::string>& requested_technologies,
const base::DictionaryValue& options,
const StringDBusMethodCallback& callback) override;
Expand Down
Loading

0 comments on commit 32d2545

Please sign in to comment.