Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: chromeos/dbus/debug_daemon_client.cc

Issue 10829396: debugd: Add TestICMP functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: |host| -> |ip_address|; fix nits. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/debug_daemon_client.h ('k') | chromeos/dbus/mock_debug_daemon_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/debug_daemon_client.cc
diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc
index 8ae9c0ab3173aa14998e3360cc45bffce7175a70..4b7571d0934d9fcd9f38f82f39b386b94815c672 100644
--- a/chromeos/dbus/debug_daemon_client.cc
+++ b/chromeos/dbus/debug_daemon_client.cc
@@ -306,6 +306,20 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
return true;
}
+ virtual void TestICMP(const std::string& ip_address,
+ const TestICMPCallback& callback) OVERRIDE {
+ dbus::MethodCall method_call(debugd::kDebugdInterface,
+ debugd::kTestICMP);
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendString(ip_address);
+ debugdaemon_proxy_->CallMethod(
+ &method_call,
+ dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::Bind(&DebugDaemonClientImpl::OnTestICMP,
+ weak_ptr_factory_.GetWeakPtr(),
+ callback));
+ }
+
private:
// Called to check descriptor validity on a thread where i/o is permitted.
static void CheckValidity(dbus::FileDescriptor* file_descriptor) {
@@ -458,6 +472,14 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
// NB: requester is signaled when i/o completes
}
+ void OnTestICMP(const TestICMPCallback& callback, dbus::Response* response) {
+ std::string status;
+ if (response && dbus::MessageReader(response).PopString(&status))
+ callback.Run(true, status);
+ else
+ callback.Run(false, "");
+ }
+
// Called when pipe i/o completes; pass data on and delete the instance.
void OnIOComplete() {
callback_.Run(base::RefCountedString::TakeString(pipe_reader_->data()));
@@ -512,6 +534,11 @@ class DebugDaemonClientStubImpl : public DebugDaemonClient {
std::map<std::string, std::string> empty;
callback.Run(false, empty);
}
+
+ virtual void TestICMP(const std::string& ip_address,
+ const TestICMPCallback& callback) OVERRIDE {
+ callback.Run(false, "");
+ }
};
DebugDaemonClient::DebugDaemonClient() {
« no previous file with comments | « chromeos/dbus/debug_daemon_client.h ('k') | chromeos/dbus/mock_debug_daemon_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698