OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/debugger/devtools_remote_listen_socket.h" | 5 #include "chrome/browser/debugger/devtools_remote_listen_socket.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 | 200 |
201 // Handle header_map_ and payload_ | 201 // Handle header_map_ and payload_ |
202 void DevToolsRemoteListenSocket::HandleMessage() { | 202 void DevToolsRemoteListenSocket::HandleMessage() { |
203 if (message_listener_ != NULL) { | 203 if (message_listener_ != NULL) { |
204 DevToolsRemoteMessage message(header_map_, payload_); | 204 DevToolsRemoteMessage message(header_map_, payload_); |
205 message_listener_->HandleMessage(message); | 205 message_listener_->HandleMessage(message); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
| 209 void DevToolsRemoteListenSocket::Listen() { |
| 210 ListenSocket::Listen(); |
| 211 } |
| 212 |
209 void DevToolsRemoteListenSocket::Accept() { | 213 void DevToolsRemoteListenSocket::Accept() { |
210 SOCKET conn = ListenSocket::Accept(socket_); | 214 SOCKET conn = ListenSocket::Accept(socket_); |
211 if (conn != INVALID_SOCKET) { | 215 if (conn != INVALID_SOCKET) { |
212 scoped_refptr<DevToolsRemoteListenSocket> sock( | 216 scoped_refptr<DevToolsRemoteListenSocket> sock( |
213 new DevToolsRemoteListenSocket(conn, | 217 new DevToolsRemoteListenSocket(conn, |
214 message_listener_)); | 218 message_listener_)); |
215 // it's up to the delegate to AddRef if it wants to keep it around | 219 // it's up to the delegate to AddRef if it wants to keep it around |
216 #if defined(OS_POSIX) | 220 #if defined(OS_POSIX) |
217 sock->WatchSocket(WAITING_READ); | 221 sock->WatchSocket(WAITING_READ); |
218 #endif | 222 #endif |
(...skipping 29 matching lines...) Expand all Loading... |
248 send_buf += sent; | 252 send_buf += sent; |
249 len_left -= sent; | 253 len_left -= sent; |
250 } | 254 } |
251 PlatformThread::YieldCurrentThread(); | 255 PlatformThread::YieldCurrentThread(); |
252 } | 256 } |
253 } | 257 } |
254 | 258 |
255 void DevToolsRemoteListenSocket::Close() { | 259 void DevToolsRemoteListenSocket::Close() { |
256 ListenSocket::Close(); | 260 ListenSocket::Close(); |
257 } | 261 } |
OLD | NEW |