| 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 "net/socket/stream_listen_socket.h" | 5 #include "net/socket/stream_listen_socket.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 // winsock2.h must be included first in order to ensure it is included before | 8 // winsock2.h must be included first in order to ensure it is included before |
| 9 // windows.h. | 9 // windows.h. |
| 10 #include <winsock2.h> | 10 #include <winsock2.h> |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 watcher_.StopWatchingFileDescriptor(); | 242 watcher_.StopWatchingFileDescriptor(); |
| 243 #endif | 243 #endif |
| 244 } | 244 } |
| 245 | 245 |
| 246 // TODO(ibrar): We can add these functions into OS dependent files. | 246 // TODO(ibrar): We can add these functions into OS dependent files. |
| 247 #if defined(OS_WIN) | 247 #if defined(OS_WIN) |
| 248 // MessageLoop watcher callback. | 248 // MessageLoop watcher callback. |
| 249 void StreamListenSocket::OnObjectSignaled(HANDLE object) { | 249 void StreamListenSocket::OnObjectSignaled(HANDLE object) { |
| 250 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. | 250 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. |
| 251 tracked_objects::ScopedTracker tracking_profile( | 251 tracked_objects::ScopedTracker tracking_profile( |
| 252 FROM_HERE_WITH_EXPLICIT_FUNCTION("StreamListenSocket_OnObjectSignaled")); | 252 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 253 "418183 StreamListenSocket::OnObjectSignaled")); |
| 253 | 254 |
| 254 WSANETWORKEVENTS ev; | 255 WSANETWORKEVENTS ev; |
| 255 if (kSocketError == WSAEnumNetworkEvents(socket_, socket_event_, &ev)) { | 256 if (kSocketError == WSAEnumNetworkEvents(socket_, socket_event_, &ev)) { |
| 256 // TODO | 257 // TODO |
| 257 return; | 258 return; |
| 258 } | 259 } |
| 259 | 260 |
| 260 // If both FD_CLOSE and FD_READ are set we only call Read(). | 261 // If both FD_CLOSE and FD_READ are set we only call Read(). |
| 261 // This will cause OnObjectSignaled to be called immediately again | 262 // This will cause OnObjectSignaled to be called immediately again |
| 262 // unless this socket is destroyed in Read(). | 263 // unless this socket is destroyed in Read(). |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 void StreamListenSocket::ResumeReads() { | 322 void StreamListenSocket::ResumeReads() { |
| 322 DCHECK(reads_paused_); | 323 DCHECK(reads_paused_); |
| 323 reads_paused_ = false; | 324 reads_paused_ = false; |
| 324 if (has_pending_reads_) { | 325 if (has_pending_reads_) { |
| 325 has_pending_reads_ = false; | 326 has_pending_reads_ = false; |
| 326 Read(); | 327 Read(); |
| 327 } | 328 } |
| 328 } | 329 } |
| 329 | 330 |
| 330 } // namespace net | 331 } // namespace net |
| OLD | NEW |