Commit acedd829 authored by Nika Layzell's avatar Nika Layzell
Browse files

Bug 1734739 - Part 3: Stop providing pids in places where it's not needed/used, r=handyman

parent c8c46693
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1164,8 +1164,7 @@ PProcessHangMonitorParent* ProcessHangMonitor::AddProcess(
  Endpoint<PProcessHangMonitorParent> parent;
  Endpoint<PProcessHangMonitorChild> child;
  nsresult rv;
  rv = PProcessHangMonitor::CreateEndpoints(
      base::GetCurrentProcId(), aContentParent->OtherPid(), &parent, &child);
  rv = PProcessHangMonitor::CreateEndpoints(&parent, &child);
  if (NS_FAILED(rv)) {
    MOZ_ASSERT(false, "PProcessHangMonitor::CreateEndpoints failed");
    return nullptr;
+5 −4
Original line number Diff line number Diff line
@@ -53,10 +53,7 @@ struct PrivateIPDLInterface {};
 * Endpoint<PFooParent> parentEp;
 * Endpoint<PFooChild> childEp;
 * nsresult rv;
 * rv = PFoo::CreateEndpoints(parentPid, childPid, &parentEp, &childEp);
 *
 * You're required to pass in parentPid and childPid, which are the pids of the
 * processes in which the parent and child endpoints will be used.
 * rv = PFoo::CreateEndpoints(&parentEp, &childEp);
 *
 * Endpoints can be passed in IPDL messages or sent to other threads using
 * PostTask. Once an Endpoint has arrived at its destination process and thread,
@@ -68,6 +65,10 @@ struct PrivateIPDLInterface {};
 *
 * (See Bind below for an explanation of processActor.) Once the actor is bound
 * to the endpoint, it can send and receive messages.
 *
 * If creating endpoints for a [NeedsOtherPid] actor, you're required to also
 * pass in parentPid and childPid, which are the pids of the processes in which
 * the parent and child endpoints will be used.
 */
template <class PFooSide>
class Endpoint {
+1 −1
Original line number Diff line number Diff line
@@ -1915,7 +1915,7 @@ void DocumentLoadListener::TriggerRedirectToRealChannel(
      }
      ParentEndpoint parent;
      nsresult rv = extensions::PStreamFilter::CreateEndpoints(
          pid, request.mChildProcessId, &parent, &request.mChildEndpoint);
          &parent, &request.mChildEndpoint);

      if (NS_FAILED(rv)) {
        request.mPromise->Reject(false, __func__);
+2 −4
Original line number Diff line number Diff line
@@ -1591,8 +1591,7 @@ nsresult nsHttpChannel::CallOnStartRequest() {
    if (mustRunStreamFilterInParent) {
      mozilla::ipc::Endpoint<extensions::PStreamFilterParent> parent;
      mozilla::ipc::Endpoint<extensions::PStreamFilterChild> child;
      nsresult rv = extensions::PStreamFilter::CreateEndpoints(
          base::GetCurrentProcId(), request.mChildProcessId, &parent, &child);
      nsresult rv = extensions::PStreamFilter::CreateEndpoints(&parent, &child);
      if (NS_FAILED(rv)) {
        request.mPromise->Reject(false, __func__);
      } else {
@@ -6403,8 +6402,7 @@ auto nsHttpChannel::AttachStreamFilter(base::ProcessId aChildProcessId)

  mozilla::ipc::Endpoint<extensions::PStreamFilterParent> parent;
  mozilla::ipc::Endpoint<extensions::PStreamFilterChild> child;
  nsresult rv = extensions::PStreamFilter::CreateEndpoints(
      ProcessId(), aChildProcessId, &parent, &child);
  nsresult rv = extensions::PStreamFilter::CreateEndpoints(&parent, &child);
  if (NS_FAILED(rv)) {
    return ChildEndpointPromise::CreateAndReject(false, __func__);
  }
+2 −3
Original line number Diff line number Diff line
@@ -61,8 +61,7 @@ void InitializeSandboxTestingActors(
  MOZ_ASSERT(aActor, "Should have provided an IPC actor");
  Endpoint<PSandboxTestingParent> sandboxTestingParentEnd;
  Endpoint<PSandboxTestingChild> sandboxTestingChildEnd;
  nsresult rv = PSandboxTesting::CreateEndpoints(
      base::GetCurrentProcId(), aActor->OtherPid(), &sandboxTestingParentEnd,
  nsresult rv = PSandboxTesting::CreateEndpoints(&sandboxTestingParentEnd,
                                                 &sandboxTestingChildEnd);
  if (NS_FAILED(rv)) {
    aProcessPromise->Reject(NS_ERROR_FAILURE, __func__);
Loading