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

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: Nits done - Prelanding checks 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
« no previous file with comments | « base/sync_socket_posix.cc ('k') | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sync_socket_win.cc
diff --git a/base/sync_socket_win.cc b/base/sync_socket_win.cc
index 26e76ec2738e6629fbf4b0c41cc61ac0b7e7d6ec..3c40ebaa6f1a9a8a296909153aeabdabb384f569 100644
--- a/base/sync_socket_win.cc
+++ b/base/sync_socket_win.cc
@@ -207,6 +207,23 @@ bool SyncSocket::CreatePair(SyncSocket* socket_a, SyncSocket* socket_b) {
return CreatePairImpl(&socket_a->handle_, &socket_b->handle_, false);
}
+// static
+SyncSocket::Handle SyncSocket::UnwrapHandle(
+ const TransitDescriptor& descriptor) {
+ return descriptor;
+}
+
+bool SyncSocket::PrepareTransitDescriptor(ProcessHandle peer_process_handle,
+ TransitDescriptor* descriptor) {
+ DCHECK(descriptor);
+ if (!::DuplicateHandle(GetCurrentProcess(), handle(), peer_process_handle,
+ descriptor, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
+ DPLOG(ERROR) << "Cannot duplicate socket handle for peer process.";
+ return false;
+ }
+ return true;
+}
+
bool SyncSocket::Close() {
if (handle_ == kInvalidHandle)
return true;
« no previous file with comments | « base/sync_socket_posix.cc ('k') | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698