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

Side by Side Diff: base/sync_socket.h

Issue 2809673002: Fix double close in MojoAudioOutputStream. (Closed)
Patch Set: Fix Win complie. Created 3 years, 8 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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 TimeDelta timeout); 86 TimeDelta timeout);
87 87
88 // Returns the number of bytes available. If non-zero, Receive() will not 88 // Returns the number of bytes available. If non-zero, Receive() will not
89 // not block when called. 89 // not block when called.
90 virtual size_t Peek(); 90 virtual size_t Peek();
91 91
92 // Extracts the contained handle. Used for transferring between 92 // Extracts the contained handle. Used for transferring between
93 // processes. 93 // processes.
94 Handle handle() const { return handle_; } 94 Handle handle() const { return handle_; }
95 95
96 // Extracts and takes ownership of the contained handle.
97 Handle Release();
98
96 protected: 99 protected:
97 Handle handle_; 100 Handle handle_;
98 101
99 private: 102 private:
100 DISALLOW_COPY_AND_ASSIGN(SyncSocket); 103 DISALLOW_COPY_AND_ASSIGN(SyncSocket);
101 }; 104 };
102 105
103 // Derives from SyncSocket and adds support for shutting down the socket from 106 // Derives from SyncSocket and adds support for shutting down the socket from
104 // another thread while a blocking Receive or Send is being done from the 107 // another thread while a blocking Receive or Send is being done from the
105 // thread that owns the socket. 108 // thread that owns the socket.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 152
150 #if defined(OS_WIN) && !defined(COMPONENT_BUILD) 153 #if defined(OS_WIN) && !defined(COMPONENT_BUILD)
151 // TODO(cpu): remove this once chrome is split in two dlls. 154 // TODO(cpu): remove this once chrome is split in two dlls.
152 __declspec(selectany) 155 __declspec(selectany)
153 const SyncSocket::Handle SyncSocket::kInvalidHandle = INVALID_HANDLE_VALUE; 156 const SyncSocket::Handle SyncSocket::kInvalidHandle = INVALID_HANDLE_VALUE;
154 #endif 157 #endif
155 158
156 } // namespace base 159 } // namespace base
157 160
158 #endif // BASE_SYNC_SOCKET_H_ 161 #endif // BASE_SYNC_SOCKET_H_
OLDNEW
« no previous file with comments | « no previous file | base/sync_socket_nacl.cc » ('j') | content/browser/renderer_host/media/audio_renderer_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698