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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 result = request.bytes_written; | 67 result = request.bytes_written; |
68 } | 68 } |
69 | 69 |
70 request.callback.Run(result); | 70 request.callback.Run(result); |
71 write_queue_.pop(); | 71 write_queue_.pop(); |
72 | 72 |
73 if (!write_queue_.empty()) | 73 if (!write_queue_.empty()) |
74 WriteData(); | 74 WriteData(); |
75 } | 75 } |
76 | 76 |
| 77 bool Socket::IsConnected() { |
| 78 return is_connected_; |
| 79 } |
| 80 |
77 bool Socket::SetKeepAlive(bool enable, int delay) { | 81 bool Socket::SetKeepAlive(bool enable, int delay) { |
78 return false; | 82 return false; |
79 } | 83 } |
80 | 84 |
81 bool Socket::SetNoDelay(bool no_delay) { | 85 bool Socket::SetNoDelay(bool no_delay) { |
82 return false; | 86 return false; |
83 } | 87 } |
84 | 88 |
85 // static | 89 // static |
86 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str, | 90 bool Socket::StringAndPortToIPEndPoint(const std::string& ip_address_str, |
(...skipping 27 matching lines...) Expand all Loading... |
114 DCHECK(port); | 118 DCHECK(port); |
115 *ip_address_str = address.ToStringWithoutPort(); | 119 *ip_address_str = address.ToStringWithoutPort(); |
116 if (ip_address_str->empty()) { | 120 if (ip_address_str->empty()) { |
117 *port = 0; | 121 *port = 0; |
118 } else { | 122 } else { |
119 *port = address.port(); | 123 *port = address.port(); |
120 } | 124 } |
121 } | 125 } |
122 | 126 |
123 } // namespace extensions | 127 } // namespace extensions |
OLD | NEW |