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

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 review comments 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 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(int backlog, std::string* error_msg) {
91 return net::ERR_NOT_IMPLEMENTED;
92 }
93
94 void Socket::Accept(const AcceptCompletionCallback& callback) {
95 callback.Run(net::ERR_NOT_IMPLEMENTED, NULL);
96 }
97
90 // static 98 // static
91 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str, 99 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str,
92 int port, 100 int port,
93 net::IPEndPoint* ip_end_point) { 101 net::IPEndPoint* ip_end_point) {
94 DCHECK(ip_end_point); 102 DCHECK(ip_end_point);
95 net::IPAddressNumber ip_number; 103 net::IPAddressNumber ip_number;
96 if (!net::ParseIPLiteralToNumber(ip_address_str, &ip_number)) 104 if (!net::ParseIPLiteralToNumber(ip_address_str, &ip_number))
97 return false; 105 return false;
98 106
99 *ip_end_point = net::IPEndPoint(ip_number, port); 107 *ip_end_point = net::IPEndPoint(ip_number, port);
(...skipping 30 matching lines...) Expand all
130 const CompletionCallback& callback) 138 const CompletionCallback& callback)
131 : io_buffer(io_buffer), 139 : io_buffer(io_buffer),
132 byte_count(byte_count), 140 byte_count(byte_count),
133 callback(callback), 141 callback(callback),
134 bytes_written(0) { 142 bytes_written(0) {
135 } 143 }
136 144
137 Socket::WriteRequest::~WriteRequest() { } 145 Socket::WriteRequest::~WriteRequest() { }
138 146
139 } // namespace extensions 147 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698