Bug 1445249 - Part 1 - Remove unused aProcessId parameter when deleting shared memory; r?jld draft
authorAlex Gaynor <agaynor@mozilla.com>
Tue, 13 Mar 2018 10:07:18 -0400
changeset 767010 7c6cf0bc3e4f63d26ddfeb4b3b1a653e765a6bda
parent 766824 8f1b2f872f0ea358a0412eb8b8687f08d47f6621
child 767011 ee0523f336cccc812ab3e22237ffab8bf402efc5
push id102475
push userbmo:agaynor@mozilla.com
push dateTue, 13 Mar 2018 19:30:50 +0000
reviewersjld
bugs1445249
milestone61.0a1
Bug 1445249 - Part 1 - Remove unused aProcessId parameter when deleting shared memory; r?jld MozReview-Commit-ID: Cn0q46Q67hd
ipc/glue/ProtocolUtils.cpp
ipc/glue/Shmem.cpp
ipc/glue/Shmem.h
--- a/ipc/glue/ProtocolUtils.cpp
+++ b/ipc/glue/ProtocolUtils.cpp
@@ -751,17 +751,17 @@ IToplevelProtocol::DestroySharedMemory(S
 {
   Shmem::id_t aId = shmem.Id(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
   Shmem::SharedMemory* segment = LookupSharedMemory(aId);
   if (!segment) {
     return false;
   }
 
   Message* descriptor = shmem.UnshareFrom(
-    Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), OtherPid(), MSG_ROUTING_CONTROL);
+    Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), MSG_ROUTING_CONTROL);
 
   mShmemMap.Remove(aId);
   Shmem::Dealloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), segment);
 
   if (!GetIPCChannel()->CanSend()) {
     delete descriptor;
     return true;
   }
--- a/ipc/glue/Shmem.cpp
+++ b/ipc/glue/Shmem.cpp
@@ -482,17 +482,16 @@ Shmem::ShareTo(IHadBetterBeIPDLCodeCalli
   }
   // close the handle to the segment after it is shared
   mSegment->CloseHandle();
   return msg;
 }
 
 IPC::Message*
 Shmem::UnshareFrom(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,
-                   base::ProcessId aTargetPid,
                    int32_t routingId)
 {
   AssertInvariants();
   return new ShmemDestroyed(routingId, mId);
 }
 
 void
 IPDLParamTraits<Shmem>::Write(IPC::Message* aMsg, IProtocol* aActor,
--- a/ipc/glue/Shmem.h
+++ b/ipc/glue/Shmem.h
@@ -210,17 +210,16 @@ public:
           int32_t routingId);
 
   // Stop sharing this with |aTargetPid|.  Return an IPC message that
   // contains enough information for the other process to unmap this
   // segment.  Return a new message if successful (owned by the
   // caller), nullptr if not.
   IPC::Message*
   UnshareFrom(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,
-              base::ProcessId aTargetPid,
               int32_t routingId);
 
   // Return a SharedMemory instance in this process using the
   // descriptor shared to us by the process that created the
   // underlying OS shmem resource.  The contents of the descriptor
   // depend on the type of SharedMemory that was passed to us.
   static already_AddRefed<SharedMemory>
   OpenExisting(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,