Bug 1497749: Get hello message from channel ID when pipe handle passed. r=jld, a=RyanVM
authorBob Owen <bobowencode@gmail.com>
Tue, 18 Dec 2018 14:26:26 +0000
changeset 509079 a6d805438104ac92b2defb7c1c771070b88c0367
parent 509078 c717fd7ff8853e8accd5c4fe0072ee8c666aa972
child 509080 774f84eedb224d5ceec2723af9c9d53a5f622c7a
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld, RyanVM
bugs1497749
milestone65.0
Bug 1497749: Get hello message from channel ID when pipe handle passed. r=jld, a=RyanVM
ipc/chromium/src/chrome/common/ipc_channel_win.cc
--- a/ipc/chromium/src/chrome/common/ipc_channel_win.cc
+++ b/ipc/chromium/src/chrome/common/ipc_channel_win.cc
@@ -68,16 +68,21 @@ Channel::ChannelImpl::ChannelImpl(const 
     : ALLOW_THIS_IN_INITIALIZER_LIST(input_state_(this)),
       ALLOW_THIS_IN_INITIALIZER_LIST(output_state_(this)),
       ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)),
       shared_secret_(0),
       waiting_for_shared_secret_(false) {
   Init(mode, listener);
 
   if (mode == MODE_SERVER) {
+    // We don't need the pipe name because we've been passed a handle, but we do
+    // need to get the shared secret from the channel_id.
+    PipeName(channel_id, &shared_secret_);
+    waiting_for_shared_secret_ = !!shared_secret_;
+
     // Use the existing handle that was dup'd to us
     pipe_ = server_pipe;
     EnqueueHelloMessage();
   } else {
     // Take the normal init path to connect to the server pipe
     CreatePipe(channel_id, mode);
   }
 }