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

Unified Diff: chromeos/dbus/icmp_packet_sender.h

Issue 17210002: Connectivity Diagnostics API: chrome.diagnostics.sendPacket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use avg instead of time 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/icmp_packet_sender.h
diff --git a/chromeos/dbus/icmp_packet_sender.h b/chromeos/dbus/icmp_packet_sender.h
new file mode 100644
index 0000000000000000000000000000000000000000..c73ad36db81ee7ba8b7c2a7da790474dc3c7c14e
--- /dev/null
+++ b/chromeos/dbus/icmp_packet_sender.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_
+#define CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_
+
xiaowenx 2013/06/17 08:19:55 #include <string>
Bei Zhang 2013/06/17 09:13:11 Done.
+#include "base/callback.h"
+#include "chromeos/chromeos_export.h"
+
+namespace chromeos {
+
+class CHROMEOS_EXPORT ICMPPacketSender {
+ public:
+ typedef base::Callback<void(bool succeeded,
+ const std::string& ip,
+ int latency)> SendCallback;
xiaowenx 2013/06/17 08:41:32 double latency
Bei Zhang 2013/06/17 09:13:11 Done.
+ ICMPPacketSender();
+ ~ICMPPacketSender();
+
+ // Send ICMP packet with given parameters.
+ // Pass NULL for omitted argument.
+ void Send(const std::string& ip, int* ttl, int* timeout, int* size,
+ const SendCallback& callback);
+
+ static ICMPPacketSender* GetInstance();
+ private:
+ void OnSend(const SendCallback& callback,
+ bool succeeded, const std::string& reply);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_

Powered by Google App Engine
This is Rietveld 408576698