| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool Socket::SetKeepAlive(bool enable, int delay) { | 81 bool Socket::SetKeepAlive(bool enable, int delay) { |
| 82 return false; | 82 return false; |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool Socket::SetNoDelay(bool no_delay) { | 85 bool Socket::SetNoDelay(bool no_delay) { |
| 86 return false; | 86 return false; |
| 87 } | 87 } |
| 88 | 88 |
| 89 int Socket::Listen(int backlog, std::string& error_msg) { |
| 90 return net::ERR_NOT_IMPLEMENTED; |
| 91 } |
| 92 |
| 93 void Socket::Accept(const AcceptCompletionCallback& callback) { |
| 94 callback.Run(net::ERR_NOT_IMPLEMENTED, NULL); |
| 95 } |
| 96 |
| 89 // static | 97 // static |
| 90 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str, | 98 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str, |
| 91 int port, | 99 int port, |
| 92 net::IPEndPoint* ip_end_point) { | 100 net::IPEndPoint* ip_end_point) { |
| 93 DCHECK(ip_end_point); | 101 DCHECK(ip_end_point); |
| 94 net::IPAddressNumber ip_number; | 102 net::IPAddressNumber ip_number; |
| 95 if (!net::ParseIPLiteralToNumber(ip_address_str, &ip_number)) | 103 if (!net::ParseIPLiteralToNumber(ip_address_str, &ip_number)) |
| 96 return false; | 104 return false; |
| 97 | 105 |
| 98 *ip_end_point = net::IPEndPoint(ip_number, port); | 106 *ip_end_point = net::IPEndPoint(ip_number, port); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 129 const CompletionCallback& callback) | 137 const CompletionCallback& callback) |
| 130 : io_buffer(io_buffer), | 138 : io_buffer(io_buffer), |
| 131 byte_count(byte_count), | 139 byte_count(byte_count), |
| 132 callback(callback), | 140 callback(callback), |
| 133 bytes_written(0) { | 141 bytes_written(0) { |
| 134 } | 142 } |
| 135 | 143 |
| 136 Socket::WriteRequest::~WriteRequest() { } | 144 Socket::WriteRequest::~WriteRequest() { } |
| 137 | 145 |
| 138 } // namespace extensions | 146 } // namespace extensions |
| OLD | NEW |