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

Unified Diff: chromeos/dbus/debug_daemon_client.cc

Issue 17210002: Connectivity Diagnostics API: chrome.diagnostics.sendPacket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change latency type to double Created 7 years, 6 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
Index: chromeos/dbus/debug_daemon_client.cc
diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc
index ac0ce8e5ec1361b6d4d5cabacfa533ef5b72b40a..1456083c52d94df26221363bf44e529651bf24ae 100644
--- a/chromeos/dbus/debug_daemon_client.cc
+++ b/chromeos/dbus/debug_daemon_client.cc
@@ -347,6 +347,39 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
callback));
}
+ virtual void TestICMPWithOptions(
+ const std::string& ip_address,
+ const std::map<std::string, std::string>& options,
+ const TestICMPCallback& callback) OVERRIDE {
+ dbus::MethodCall method_call(debugd::kDebugdInterface,
+ debugd::kTestICMPWithOptions);
+ dbus::MessageWriter writer(&method_call);
+ dbus::MessageWriter sub_writer(NULL);
+ dbus::MessageWriter elem_writer(NULL);
+
+ // Write the host.
+ writer.AppendString(ip_address);
+
+ // Write the options.
+ writer.OpenArray("{ss}", &sub_writer);
+ std::map<std::string, std::string>::const_iterator it;
+ for (it = options.begin(); it != options.end(); ++it) {
+ sub_writer.OpenDictEntry(&elem_writer);
+ elem_writer.AppendString(it->first);
+ elem_writer.AppendString(it->second);
+ sub_writer.CloseContainer(&elem_writer);
+ }
+ writer.CloseContainer(&sub_writer);
+
+ // Call the function.
+ 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) {
@@ -615,6 +648,14 @@ class DebugDaemonClientStubImpl : public DebugDaemonClient {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(callback, false, ""));
}
+
+ virtual void TestICMPWithOptions(
+ const std::string& ip_address,
+ const std::map<std::string, std::string>& options,
+ const TestICMPCallback& callback) OVERRIDE {
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, false, ""));
+ }
};
DebugDaemonClient::DebugDaemonClient() {

Powered by Google App Engine
This is Rietveld 408576698