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

Unified Diff: chrome/browser/extensions/api/diagnostics_private/send_ping_packet.h

Issue 17210002: Connectivity Diagnostics API: chrome.diagnostics.sendPacket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes 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: chrome/browser/extensions/api/diagnostics_private/send_ping_packet.h
diff --git a/chrome/browser/extensions/api/diagnostics_private/send_ping_packet.h b/chrome/browser/extensions/api/diagnostics_private/send_ping_packet.h
new file mode 100644
index 0000000000000000000000000000000000000000..aac48abcee353ab12b6a68f189a2f20b561c9574
--- /dev/null
+++ b/chrome/browser/extensions/api/diagnostics_private/send_ping_packet.h
@@ -0,0 +1,37 @@
+// 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 CHROME_BROWSER_EXTENSIONS_API_DIAGNOSTICS_PRIVATE_SEND_PING_PACKET_H_
+#define CHROME_BROWSER_EXTENSIONS_API_DIAGNOSTICS_PRIVATE_SEND_PING_PACKET_H_
+
+#include <string>
+
+#include "base/callback.h"
+
+namespace extensions {
+
+enum SendPingPacketErrorCode {
stevenjb 2013/06/18 22:14:51 This should really be SendPingPacketResultCode sin
Bei Zhang 2013/06/18 23:48:40 Done.
+ SEND_PING_PACKET_OK,
+ SEND_PING_PACKET_NOT_IMPLEMENTED,
+ SEND_PING_PACKET_FAILED,
+};
+
+// Callback for extensions::SendPingPacket
+typedef base::Callback<void(SendPingPacketErrorCode error_code,
+ const std::string& ip,
+ double latency)>
+ SendPingPacketCallback;
+
+// Sends an ICMP packet with given parameters.
+// Passes NULL for omitted arguments.
+void SendPingPacket(
+ const std::string& ip,
+ const int* ttl,
+ const int* timeout,
+ const int* size,
+ const SendPingPacketCallback& callback);
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_DIAGNOSTICS_PRIVATE_SEND_PING_PACKET_H_

Powered by Google App Engine
This is Rietveld 408576698