Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_ | |
| 6 #define CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_ | |
| 7 | |
|
xiaowenx
2013/06/17 08:19:55
#include <string>
Bei Zhang
2013/06/17 09:13:11
Done.
| |
| 8 #include "base/callback.h" | |
| 9 #include "chromeos/chromeos_export.h" | |
| 10 | |
| 11 namespace chromeos { | |
| 12 | |
| 13 class CHROMEOS_EXPORT ICMPPacketSender { | |
| 14 public: | |
| 15 typedef base::Callback<void(bool succeeded, | |
| 16 const std::string& ip, | |
| 17 int latency)> SendCallback; | |
|
xiaowenx
2013/06/17 08:41:32
double latency
Bei Zhang
2013/06/17 09:13:11
Done.
| |
| 18 ICMPPacketSender(); | |
| 19 ~ICMPPacketSender(); | |
| 20 | |
| 21 // Send ICMP packet with given parameters. | |
| 22 // Pass NULL for omitted argument. | |
| 23 void Send(const std::string& ip, int* ttl, int* timeout, int* size, | |
| 24 const SendCallback& callback); | |
| 25 | |
| 26 static ICMPPacketSender* GetInstance(); | |
| 27 private: | |
| 28 void OnSend(const SendCallback& callback, | |
| 29 bool succeeded, const std::string& reply); | |
| 30 }; | |
| 31 | |
| 32 } // namespace chromeos | |
| 33 | |
| 34 #endif // CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_ | |
| OLD | NEW |