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

Unified Diff: base/sync_socket_posix.cc

Issue 525313002: SyncSocket Transit Descriptor - refactoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor audio_output_device_unittest.cc Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: base/sync_socket_posix.cc
diff --git a/base/sync_socket_posix.cc b/base/sync_socket_posix.cc
index 93a01d1b1c20699e134136c47d403f26837c9f44..4a6a5e920894c10c6df417b55aeb5fcb643a529f 100644
--- a/base/sync_socket_posix.cc
+++ b/base/sync_socket_posix.cc
@@ -96,6 +96,21 @@ bool SyncSocket::CreatePair(SyncSocket* socket_a, SyncSocket* socket_b) {
return true;
}
+// static
+SyncSocket::Handle SyncSocket::UnwrapHandle(
+ const SyncSocket::TransitDescriptor& descriptor) {
+ return static_cast<SyncSocket::Handle>(descriptor.fd);
+}
+
+bool SyncSocket::PrepareTransitDescriptor(
+ ProcessHandle peer_process_handle,
+ SyncSocket::TransitDescriptor* descriptor) {
+ // |TransitDescriptor| on POSIX is a |FileDescriptor|.
+ descriptor->fd = handle();
+ descriptor->auto_close = false;
+ return (descriptor->fd != -1);
tommi (sloooow) - chröme 2014/09/04 11:34:10 Should you be using kInvalidHandle here? nit: ()
burnik 2014/09/04 12:24:43 Done.
+}
+
bool SyncSocket::Close() {
const bool retval = CloseHandle(handle_);
handle_ = kInvalidHandle;
« no previous file with comments | « base/sync_socket_nacl.cc ('k') | base/sync_socket_win.cc » ('j') | base/sync_socket_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698