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

Side by Side 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: Address comments, set default for listen backlog to 5 Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/socket/socket.h" 5 #include "chrome/browser/extensions/api/socket/socket.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/extensions/api/api_resource_event_notifier.h" 8 #include "chrome/browser/extensions/api/api_resource_event_notifier.h"
9 #include "net/base/address_list.h" 9 #include "net/base/address_list.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 bool Socket::SetKeepAlive(bool enable, int delay) { 82 bool Socket::SetKeepAlive(bool enable, int delay) {
83 return false; 83 return false;
84 } 84 }
85 85
86 bool Socket::SetNoDelay(bool no_delay) { 86 bool Socket::SetNoDelay(bool no_delay) {
87 return false; 87 return false;
88 } 88 }
89 89
90 int Socket::Listen(const std::string& address, int port, int backlog,
91 std::string* error_msg) {
92 NOTREACHED();
93 return net::ERR_NOT_IMPLEMENTED;
miket_OOO 2012/09/26 17:17:55 See comments in earlier patch. I retract my reques
justinlin 2012/09/26 20:53:12 Done.
94 }
95
96 void Socket::Accept(const AcceptCompletionCallback& callback) {
97 NOTREACHED();
98 callback.Run(net::ERR_NOT_IMPLEMENTED, NULL);
miket_OOO 2012/09/26 17:17:55 Same as above.
justinlin 2012/09/26 20:53:12 Done.
99 }
100
90 // static 101 // static
91 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str, 102 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str,
92 int port, 103 int port,
93 net::IPEndPoint* ip_end_point) { 104 net::IPEndPoint* ip_end_point) {
94 DCHECK(ip_end_point); 105 DCHECK(ip_end_point);
95 net::IPAddressNumber ip_number; 106 net::IPAddressNumber ip_number;
96 if (!net::ParseIPLiteralToNumber(ip_address_str, &ip_number)) 107 if (!net::ParseIPLiteralToNumber(ip_address_str, &ip_number))
97 return false; 108 return false;
98 109
99 *ip_end_point = net::IPEndPoint(ip_number, port); 110 *ip_end_point = net::IPEndPoint(ip_number, port);
(...skipping 30 matching lines...) Expand all
130 const CompletionCallback& callback) 141 const CompletionCallback& callback)
131 : io_buffer(io_buffer), 142 : io_buffer(io_buffer),
132 byte_count(byte_count), 143 byte_count(byte_count),
133 callback(callback), 144 callback(callback),
134 bytes_written(0) { 145 bytes_written(0) {
135 } 146 }
136 147
137 Socket::WriteRequest::~WriteRequest() { } 148 Socket::WriteRequest::~WriteRequest() { }
138 149
139 } // namespace extensions 150 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698