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 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "chromeos/chromeos_export.h" | |
| 12 | |
| 13 namespace chromeos { | |
| 14 | |
| 15 class CHROMEOS_EXPORT ICMPPacketSender { | |
| 16 public: | |
| 17 typedef base::Callback<void(bool succeeded, | |
| 18 const std::string& ip, | |
| 19 double latency)> SendCallback; | |
| 20 ICMPPacketSender(); | |
| 21 ~ICMPPacketSender(); | |
| 22 | |
| 23 // Send ICMP packet with given parameters. | |
| 24 // 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.
| |
| 25 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.
| |
| 26 const SendCallback& callback); | |
|
stevenjb
2013/06/17 17:24:24
One parameter per line
Bei Zhang
2013/06/18 18:00:41
Done.
| |
| 27 | |
| 28 static ICMPPacketSender* GetInstance(); | |
|
stevenjb
2013/06/17 17:24:24
nit: blank line
Bei Zhang
2013/06/18 18:00:41
Done.
| |
| 29 private: | |
| 30 void OnSend(const SendCallback& callback, | |
| 31 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.
| |
| 32 }; | |
| 33 | |
| 34 } // namespace chromeos | |
| 35 | |
| 36 #endif // CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_ | |
| OLD | NEW |