Chromium Code Reviews| 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_ |