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

Unified Diff: chromeos/dbus/packet_sender.h

Issue 17210002: Connectivity Diagnostics API: chrome.diagnostics.sendPacket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/packet_sender.h
diff --git a/chromeos/dbus/packet_sender.h b/chromeos/dbus/packet_sender.h
new file mode 100644
index 0000000000000000000000000000000000000000..d8e8f29b70ae6552da48c6be171974edcc7824a9
--- /dev/null
+++ b/chromeos/dbus/packet_sender.h
@@ -0,0 +1,30 @@
+// 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_PACKET_SENDER_H_
+#define CHROMEOS_DBUS_PACKET_SENDER_H_
+
+#include "base/callback.h"
+#include "base/values.h"
+#include "chromeos/chromeos_export.h"
+
+namespace chromeos {
+
+class CHROMEOS_EXPORT PacketSender {
+ public:
+ typedef base::Callback<void(bool succeeded,
+ std::string ip, int latency)> SendCallback;
xiaowenx 2013/06/17 06:19:38 can we use const std::string& ip here?
Bei Zhang 2013/06/17 07:30:54 Done.
Bei Zhang 2013/06/17 07:30:54 Done.
+ PacketSender();
+ virtual ~PacketSender();
xiaowenx 2013/06/17 06:19:38 is there a reason to use virtual destructor?
+ void Send(std::string ip, std::string type, int ttl, int timeout, int size,
xiaowenx 2013/06/17 06:19:38 can we use const std::string& ip here?
Bei Zhang 2013/06/17 07:30:54 Done.
+ const SendCallback& callback);
+
+ static PacketSender* GetInstance();
+ private:
+ void OnSend(const SendCallback& callback,
+ bool succeeded, const std::string& reply);
+};
+
+} // namespace chromeos
xiaowenx 2013/06/17 06:19:38 it looks better to insert an empty line here :)
Bei Zhang 2013/06/17 07:30:54 Done.
+#endif // CHROMEOS_DBUS_PACKET_SENDER_H_

Powered by Google App Engine
This is Rietveld 408576698