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

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: 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/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..97a0b0d10efad58890ef1494b2cc4ce87d6bfbb5
--- /dev/null
+++ b/chromeos/dbus/icmp_packet_sender.h
@@ -0,0 +1,36 @@
+// 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_
+
+#include <string>
+
+#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,
+ double latency)> SendCallback;
+ ICMPPacketSender();
+ ~ICMPPacketSender();
+
+ // Send ICMP packet with given parameters.
+ // Pass NULL for omitted argument.
stevenjb 2013/06/17 17:24:24 s/Send/Sends/ s/Pass/Passes/ s/argument/arguments/
Bei Zhang 2013/06/18 18:00:41 Done.
+ void Send(const std::string& ip, int* ttl, int* timeout, int* size,
stevenjb 2013/06/17 17:24:24 Use const int* for optional input parameters.
Bei Zhang 2013/06/18 18:00:41 Done.
+ const SendCallback& callback);
stevenjb 2013/06/17 17:24:24 One parameter per line
Bei Zhang 2013/06/18 18:00:41 Done.
+
+ static ICMPPacketSender* GetInstance();
stevenjb 2013/06/17 17:24:24 nit: blank line
Bei Zhang 2013/06/18 18:00:41 Done.
+ private:
+ void OnSend(const SendCallback& callback,
+ bool succeeded, const std::string& reply);
stevenjb 2013/06/17 17:24:24 One param per line (but see note about making this
Bei Zhang 2013/06/18 18:00:41 Done.
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_

Powered by Google App Engine
This is Rietveld 408576698