Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef NET_BASE_TCP_CLIENT_SOCKET_H_ | 5 #ifndef NET_BASE_TCP_CLIENT_SOCKET_H_ |
| 6 #define NET_BASE_TCP_CLIENT_SOCKET_H_ | 6 #define NET_BASE_TCP_CLIENT_SOCKET_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 NOT_WAITING, | 79 NOT_WAITING, |
| 80 WAITING_CONNECT, | 80 WAITING_CONNECT, |
| 81 WAITING_READ, | 81 WAITING_READ, |
| 82 WAITING_WRITE | 82 WAITING_WRITE |
| 83 }; | 83 }; |
| 84 WaitState wait_state_; | 84 WaitState wait_state_; |
| 85 | 85 |
| 86 // base::ObjectWatcher::Delegate methods: | 86 // base::ObjectWatcher::Delegate methods: |
| 87 virtual void OnObjectSignaled(HANDLE object); | 87 virtual void OnObjectSignaled(HANDLE object); |
| 88 | 88 |
| 89 // After a Winsock function succeeds synchronously, waits for the | |
|
eroman
2009/01/30 21:44:46
This should probably be wrapped in a:
#if defined
wtc
2009/01/30 21:48:06
Yes, this is a Windows-specific method. It is alr
eroman
2009/01/30 21:55:17
Oh right, didn't notice!
LGTM.
| |
| 90 // (manual-reset) event object to become signaled and resets it. | |
| 91 // | |
| 92 // Our testing shows that except in rare cases (when running inside QEMU), | |
| 93 // the event object is already signaled at this point, so we just call this | |
| 94 // method on the IO thread to avoid a context switch. | |
| 95 void WaitForAndResetEvent(); | |
| 96 | |
| 89 OVERLAPPED overlapped_; | 97 OVERLAPPED overlapped_; |
| 90 WSABUF buffer_; | 98 WSABUF buffer_; |
| 91 | 99 |
| 92 base::ObjectWatcher watcher_; | 100 base::ObjectWatcher watcher_; |
| 93 | 101 |
| 94 void DidCompleteIO(); | 102 void DidCompleteIO(); |
| 95 #elif defined(OS_POSIX) | 103 #elif defined(OS_POSIX) |
| 96 // Whether we're currently waiting for connect() to complete | 104 // Whether we're currently waiting for connect() to complete |
| 97 bool waiting_connect_; | 105 bool waiting_connect_; |
| 98 | 106 |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 124 | 132 |
| 125 int CreateSocket(const struct addrinfo* ai); | 133 int CreateSocket(const struct addrinfo* ai); |
| 126 void DoCallback(int rv); | 134 void DoCallback(int rv); |
| 127 void DidCompleteConnect(); | 135 void DidCompleteConnect(); |
| 128 }; | 136 }; |
| 129 | 137 |
| 130 } // namespace net | 138 } // namespace net |
| 131 | 139 |
| 132 #endif // NET_BASE_TCP_CLIENT_SOCKET_H_ | 140 #endif // NET_BASE_TCP_CLIENT_SOCKET_H_ |
| 133 | 141 |
| OLD | NEW |