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

Unified Diff: chrome/browser/extensions/api/socket/socket.cc

Issue 10827390: Implement chrome.socket.bind/listen/accept for TCP server socket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 3 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
« no previous file with comments | « chrome/browser/extensions/api/socket/socket.h ('k') | chrome/browser/extensions/api/socket/socket_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/socket/socket.cc
diff --git a/chrome/browser/extensions/api/socket/socket.cc b/chrome/browser/extensions/api/socket/socket.cc
index 3d297217896471e1bcdcdc04a870891dc1532d70..024d71390c0c48b53b75f76c9f4d7dd83d4ac38b 100644
--- a/chrome/browser/extensions/api/socket/socket.cc
+++ b/chrome/browser/extensions/api/socket/socket.cc
@@ -14,6 +14,8 @@
namespace extensions {
+const char kSocketTypeNotSupported[] = "Socket type does not support this API";
+
Socket::Socket(const std::string& owner_extension_id,
ApiResourceEventNotifier* event_notifier)
: ApiResource(owner_extension_id, event_notifier),
@@ -87,6 +89,16 @@ bool Socket::SetNoDelay(bool no_delay) {
return false;
}
+int Socket::Listen(const std::string& address, int port, int backlog,
+ std::string* error_msg) {
+ *error_msg = kSocketTypeNotSupported;
+ return net::ERR_FAILED;
+}
+
+void Socket::Accept(const AcceptCompletionCallback& callback) {
+ callback.Run(net::ERR_FAILED, NULL);
+}
+
// static
bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str,
int port,
« no previous file with comments | « chrome/browser/extensions/api/socket/socket.h ('k') | chrome/browser/extensions/api/socket/socket_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698