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

Unified Diff: base/sync_socket_win.cc

Issue 525313002: SyncSocket Transit Descriptor - refactoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clang formatting and nits addressed Created 6 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 side-by-side diff with in-line comments
Download patch
Index: base/sync_socket_win.cc
diff --git a/base/sync_socket_win.cc b/base/sync_socket_win.cc
index 26e76ec2738e6629fbf4b0c41cc61ac0b7e7d6ec..633b65e386453aa3478804176b25e9b44069e199 100644
--- a/base/sync_socket_win.cc
+++ b/base/sync_socket_win.cc
@@ -207,6 +207,21 @@ bool SyncSocket::CreatePair(SyncSocket* socket_a, SyncSocket* socket_b) {
return CreatePairImpl(&socket_a->handle_, &socket_b->handle_, false);
}
+// static
+SyncSocket::Handle SyncSocket::UnwrapHandle(
+ const SyncSocket::TransitDescriptor& descriptor) {
+ return (SyncSocket::Handle)descriptor;
tommi (sloooow) - chröme 2014/09/04 11:34:10 use C++ casts (is a cast actually necessary here?
burnik 2014/09/06 18:17:09 Casting removed. On 2014/09/04 11:34:10, tommi wro
+}
+
+bool SyncSocket::PrepareTransitDescriptor(
+ ProcessHandle peer_process_handle,
+ SyncSocket::TransitDescriptor* descriptor) {
+ // |TransitDescriptor| on Windows is the |Handle| itself
burnik 2014/09/01 15:18:20 I don't always finish a sentence, but when I do
burnik 2014/09/02 10:02:54 Done.
no longer working on chromium 2014/09/02 10:25:04 It doesn't seem done yet.
tommi (sloooow) - chröme 2014/09/04 11:34:10 Yeah, that sentence is only half
burnik 2014/09/06 18:17:09 Comment removed. On 2014/09/04 11:34:10, tommi wro
burnik 2014/09/06 18:17:09 Acknowledged.
+ ::DuplicateHandle(GetCurrentProcess(), handle(), peer_process_handle,
+ descriptor, 0, FALSE, DUPLICATE_SAME_ACCESS);
+ return (*descriptor != 0);
tommi (sloooow) - chröme 2014/09/04 11:34:10 nit: no ()
burnik 2014/09/06 18:17:10 Refactored in latest. On 2014/09/04 11:34:10, tomm
+}
+
bool SyncSocket::Close() {
if (handle_ == kInvalidHandle)
return true;

Powered by Google App Engine
This is Rietveld 408576698