Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: base/sync_socket.h

Issue 22886005: Switch audio synchronization from sleep() based to select() based. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/sync_socket_posix.cc » ('j') | base/sync_socket_posix.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_SYNC_SOCKET_H_ 5 #ifndef BASE_SYNC_SOCKET_H_
6 #define BASE_SYNC_SOCKET_H_ 6 #define BASE_SYNC_SOCKET_H_
7 7
8 // A socket abstraction used for sending and receiving plain 8 // A socket abstraction used for sending and receiving plain
9 // data. Because the receiving is blocking, they can be used to perform 9 // data. Because the receiving is blocking, they can be used to perform
10 // rudimentary cross-process synchronization with low latency. 10 // rudimentary cross-process synchronization with low latency.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // buffer is a pointer to the data to send. 50 // buffer is a pointer to the data to send.
51 // length is the length of the data to send (must be non-zero). 51 // length is the length of the data to send (must be non-zero).
52 // Returns the number of bytes sent, or 0 upon failure. 52 // Returns the number of bytes sent, or 0 upon failure.
53 virtual size_t Send(const void* buffer, size_t length); 53 virtual size_t Send(const void* buffer, size_t length);
54 54
55 // Receives a message from an SyncSocket. 55 // Receives a message from an SyncSocket.
56 // buffer is a pointer to the buffer to receive data. 56 // buffer is a pointer to the buffer to receive data.
57 // length is the number of bytes of data to receive (must be non-zero). 57 // length is the number of bytes of data to receive (must be non-zero).
58 // Returns the number of bytes received, or 0 upon failure. 58 // Returns the number of bytes received, or 0 upon failure.
59 virtual size_t Receive(void* buffer, size_t length); 59 virtual size_t Receive(void* buffer, size_t length);
60 virtual size_t Receive(void* buffer, size_t length, base::TimeDelta timeout);
henrika (OOO until Aug 14) 2013/08/20 07:50:30 Extend comment for new parameter.
DaleCurtis 2013/09/11 01:16:03 Done.
60 61
61 // Returns the number of bytes available. If non-zero, Receive() will not 62 // Returns the number of bytes available. If non-zero, Receive() will not
62 // not block when called. NOTE: Some implementations cannot reliably 63 // not block when called. NOTE: Some implementations cannot reliably
63 // determine the number of bytes available so avoid using the returned 64 // determine the number of bytes available so avoid using the returned
64 // size as a promise and simply test against zero. 65 // size as a promise and simply test against zero.
65 size_t Peek(); 66 size_t Peek();
66 67
67 // Extracts the contained handle. Used for transferring between 68 // Extracts the contained handle. Used for transferring between
68 // processes. 69 // processes.
69 Handle handle() const { return handle_; } 70 Handle handle() const { return handle_; }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 122
122 #if defined(OS_WIN) && !defined(COMPONENT_BUILD) 123 #if defined(OS_WIN) && !defined(COMPONENT_BUILD)
123 // TODO(cpu): remove this once chrome is split in two dlls. 124 // TODO(cpu): remove this once chrome is split in two dlls.
124 __declspec(selectany) 125 __declspec(selectany)
125 const SyncSocket::Handle SyncSocket::kInvalidHandle = INVALID_HANDLE_VALUE; 126 const SyncSocket::Handle SyncSocket::kInvalidHandle = INVALID_HANDLE_VALUE;
126 #endif 127 #endif
127 128
128 } // namespace base 129 } // namespace base
129 130
130 #endif // BASE_SYNC_SOCKET_H_ 131 #endif // BASE_SYNC_SOCKET_H_
OLDNEW
« no previous file with comments | « no previous file | base/sync_socket_posix.cc » ('j') | base/sync_socket_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698