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 "base/sync_socket.h" | 5 #include "base/sync_socket.h" |
6 #include <limits.h> | 6 #include <limits.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include "base/atomicops.h" | |
11 #include "base/logging.h" | 10 #include "base/logging.h" |
12 | 11 |
13 | 12 |
14 namespace base { | 13 namespace base { |
15 | 14 |
16 namespace { | 15 namespace { |
17 // This prefix used to be appended to pipe names for pipes | 16 // This prefix used to be appended to pipe names for pipes |
18 // created in CreatePair. | 17 // created in CreatePair. |
19 const wchar_t kPipePrefix[] = L"\\\\.\\pipe\\chrome.sync."; | 18 const wchar_t kPipePrefix[] = L"\\\\.\\pipe\\chrome.sync."; |
20 const size_t kPipePrefixSize = arraysize(kPipePrefix); | 19 const size_t kPipePrefixSize = arraysize(kPipePrefix); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 return count; | 140 return count; |
142 } | 141 } |
143 | 142 |
144 size_t SyncSocket::Peek() { | 143 size_t SyncSocket::Peek() { |
145 DWORD available = 0; | 144 DWORD available = 0; |
146 PeekNamedPipe(handle_, NULL, 0, NULL, &available, NULL); | 145 PeekNamedPipe(handle_, NULL, 0, NULL, &available, NULL); |
147 return available; | 146 return available; |
148 } | 147 } |
149 | 148 |
150 } // namespace base | 149 } // namespace base |
OLD | NEW |