OLD | NEW |
---|---|
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 Loading... | |
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 return net::ERR_FAILED; | |
miket_OOO
2012/09/26 21:02:44
Good stuff, thanks. This looks much better.
Next
justinlin
2012/09/26 23:03:57
Done. Added the error message. I think write() was
| |
93 } | |
94 | |
95 void Socket::Accept(const AcceptCompletionCallback& callback) { | |
96 callback.Run(net::ERR_FAILED, NULL); | |
97 } | |
98 | |
90 // static | 99 // static |
91 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str, | 100 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str, |
92 int port, | 101 int port, |
93 net::IPEndPoint* ip_end_point) { | 102 net::IPEndPoint* ip_end_point) { |
94 DCHECK(ip_end_point); | 103 DCHECK(ip_end_point); |
95 net::IPAddressNumber ip_number; | 104 net::IPAddressNumber ip_number; |
96 if (!net::ParseIPLiteralToNumber(ip_address_str, &ip_number)) | 105 if (!net::ParseIPLiteralToNumber(ip_address_str, &ip_number)) |
97 return false; | 106 return false; |
98 | 107 |
99 *ip_end_point = net::IPEndPoint(ip_number, port); | 108 *ip_end_point = net::IPEndPoint(ip_number, port); |
(...skipping 30 matching lines...) Expand all Loading... | |
130 const CompletionCallback& callback) | 139 const CompletionCallback& callback) |
131 : io_buffer(io_buffer), | 140 : io_buffer(io_buffer), |
132 byte_count(byte_count), | 141 byte_count(byte_count), |
133 callback(callback), | 142 callback(callback), |
134 bytes_written(0) { | 143 bytes_written(0) { |
135 } | 144 } |
136 | 145 |
137 Socket::WriteRequest::~WriteRequest() { } | 146 Socket::WriteRequest::~WriteRequest() { } |
138 | 147 |
139 } // namespace extensions | 148 } // namespace extensions |
OLD | NEW |