Bug 1545827: Use TabId instead of PBrowserOrId, use LoadInfoArgs to avoid using the system principal on the socket process, and use PSocketProcess for the WebrtcProxyChannel when on the socket process. r=kershaw,mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 26 Apr 2019 14:46:26 +0000
changeset 530312 7ed63d730876b816eb7b91419763208951663a36
parent 530311 7e39562216125471121260f5f9775be2a6432d65
child 530313 43f6ce8cb91b45fc8bf361d91d8b61d3dd3e0050
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskershaw, mjf
bugs1545827
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1545827: Use TabId instead of PBrowserOrId, use LoadInfoArgs to avoid using the system principal on the socket process, and use PSocketProcess for the WebrtcProxyChannel when on the socket process. r=kershaw,mjf Differential Revision: https://phabricator.services.mozilla.com/D28239
dom/media/webrtc/MediaTransportParent.h
dom/media/webrtc/PMediaTransport.ipdl
media/mtransport/WebrtcProxyChannelWrapper.cpp
media/mtransport/ipc/PWebrtcProxyChannel.ipdl
media/mtransport/ipc/WebrtcProxyChannel.cpp
media/mtransport/ipc/WebrtcProxyChannel.h
media/mtransport/ipc/WebrtcProxyChannelChild.cpp
media/mtransport/ipc/WebrtcProxyChannelChild.h
media/mtransport/ipc/WebrtcProxyChannelParent.cpp
media/mtransport/ipc/WebrtcProxyChannelParent.h
media/mtransport/nr_socket_proxy_config.cpp
media/mtransport/nr_socket_proxy_config.h
media/mtransport/test/proxy_tunnel_socket_unittest.cpp
media/mtransport/test/webrtcproxychannel_unittest.cpp
media/webrtc/signaling/src/peerconnection/MediaTransportHandlerIPC.cpp
media/webrtc/signaling/src/peerconnection/MediaTransportParent.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
netwerk/ipc/NeckoChild.cpp
netwerk/ipc/NeckoChild.h
netwerk/ipc/NeckoParent.cpp
netwerk/ipc/NeckoParent.h
netwerk/ipc/PNecko.ipdl
netwerk/ipc/PSocketProcess.ipdl
netwerk/ipc/SocketProcessParent.cpp
netwerk/ipc/SocketProcessParent.h
--- a/dom/media/webrtc/MediaTransportParent.h
+++ b/dom/media/webrtc/MediaTransportParent.h
@@ -19,17 +19,18 @@ class MediaTransportParent : public dom:
   mozilla::ipc::IPCResult RecvGetIceLog(const nsCString& pattern,
                                         GetIceLogResolver&& aResolve);
   mozilla::ipc::IPCResult RecvClearIceLog();
   mozilla::ipc::IPCResult RecvEnterPrivateMode();
   mozilla::ipc::IPCResult RecvExitPrivateMode();
   mozilla::ipc::IPCResult RecvCreateIceCtx(
       const string& name, nsTArray<RTCIceServer>&& iceServers,
       const RTCIceTransportPolicy& icePolicy);
-  mozilla::ipc::IPCResult RecvSetProxyServer(const PBrowserOrId& browserOrId,
+  mozilla::ipc::IPCResult RecvSetProxyServer(const dom::TabId& tabId,
+                                             const net::LoadInfoArgs& args,
                                              const nsCString& alpn);
   mozilla::ipc::IPCResult RecvEnsureProvisionalTransport(
       const string& transportId, const string& localUfrag,
       const string& localPwd, const int& componentCount);
   mozilla::ipc::IPCResult RecvStartIceGathering(
       const bool& defaultRouteOnly, const net::NrIceStunAddrArray& stunAddrs);
   mozilla::ipc::IPCResult RecvActivateTransport(
       const string& transportId, const string& localUfrag,
--- a/dom/media/webrtc/PMediaTransport.ipdl
+++ b/dom/media/webrtc/PMediaTransport.ipdl
@@ -1,29 +1,30 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include protocol PSocketProcessBridge;
 
 #ifdef MOZ_WEBRTC
-include PBrowserOrId;
+include NeckoChannelParams;
 
 // ParamTraits stuff for generated code and other classes we don't want to change
 include "mozilla/net/NrIceStunAddrMessageUtils.h";
 include "mozilla/media/webrtc/WebrtcIPCTraits.h";
 using StringVector from "mozilla/media/webrtc/WebrtcIPCTraits.h";
 using CandidateInfo from "mozilla/media/webrtc/WebrtcIPCTraits.h";
 using DtlsDigestList from "mozilla/media/webrtc/WebrtcIPCTraits.h";
 using std::string from "ipc/IPCMessageUtils.h";
 using struct mozilla::dom::RTCStatsReportInternal from "mozilla/dom/RTCStatsReportBinding.h";
 using struct mozilla::dom::MovableRTCStatsReportInternal from "mozilla/media/webrtc/WebrtcGlobal.h";
 using WebrtcGlobalLog from "mozilla/media/webrtc/WebrtcGlobal.h";
 using mozilla::dom::RTCIceServer from "mozilla/dom/RTCConfigurationBinding.h";
 using mozilla::dom::RTCIceTransportPolicy from "mozilla/dom/RTCConfigurationBinding.h";
+using TabId from "mozilla/dom/ipc/IdType.h";
 
 // ParamTraits stuff for our own classes
 using MediaPacket from "mtransport/mediapacket.h";
 using net::NrIceStunAddrArray from "mozilla/net/PStunAddrsParams.h";
 #endif // MOZ_WEBRTC
 
 namespace mozilla {
 namespace dom {
@@ -39,17 +40,18 @@ parent:
   async ClearIceLog();
   async EnterPrivateMode();
   async ExitPrivateMode();
 
   async CreateIceCtx(string name,
                      RTCIceServer[] iceServers,
                      RTCIceTransportPolicy icePolicy);
 
-  async SetProxyServer(PBrowserOrId browserOrId,
+  async SetProxyServer(TabId id,
+                       LoadInfoArgs args, // Does this have the id?
                        nsCString alpn);
 
   async EnsureProvisionalTransport(string transportId,
                                    string localUfrag,
                                    string localPwd,
                                    int componentCount);
 
   async StartIceGathering(bool defaultRouteOnly,
--- a/media/mtransport/WebrtcProxyChannelWrapper.cpp
+++ b/media/mtransport/WebrtcProxyChannelWrapper.cpp
@@ -2,16 +2,18 @@
 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WebrtcProxyChannelWrapper.h"
 
 #include "mozilla/net/WebrtcProxyChannelChild.h"
+#include "ipc/WebrtcProxyChannel.h"
+#include "mozilla/LoadInfo.h"
 
 #include "nsIEventTarget.h"
 #include "nsNetCID.h"
 #include "nsProxyRelease.h"
 
 #include "nr_socket_proxy_config.h"
 
 namespace mozilla {
@@ -49,19 +51,19 @@ void WebrtcProxyChannelWrapper::AsyncOpe
                           const shared_ptr<NrSocketProxyConfig>>(
             "WebrtcProxyChannelWrapper::AsyncOpen", this,
             &WebrtcProxyChannelWrapper::AsyncOpen, aHost, aPort, aConfig)));
     return;
   }
 
   MOZ_ASSERT(!mWebrtcProxyChannel, "wrapper already open");
   mWebrtcProxyChannel = new WebrtcProxyChannelChild(this);
-  mWebrtcProxyChannel->AsyncOpen(aHost, aPort, aConfig->GetBrowser(),
-                                 nsContentUtils::GetSystemPrincipal(),
-                                 aConfig->GetAlpn());
+  mWebrtcProxyChannel->AsyncOpen(aHost, aPort, aConfig->GetLoadInfoArgs(),
+                                 aConfig->GetAlpn(),
+                                 dom::TabId(aConfig->GetTabId()));
 }
 
 void WebrtcProxyChannelWrapper::SendWrite(nsTArray<uint8_t>&& aReadData) {
   if (!NS_IsMainThread()) {
     MOZ_ALWAYS_SUCCEEDS(
         mMainThread->Dispatch(NewRunnableMethod<nsTArray<uint8_t>&&>(
             "WebrtcProxyChannelWrapper::SendWrite", this,
             &WebrtcProxyChannelWrapper::SendWrite, std::move(aReadData))));
--- a/media/mtransport/ipc/PWebrtcProxyChannel.ipdl
+++ b/media/mtransport/ipc/PWebrtcProxyChannel.ipdl
@@ -4,28 +4,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include protocol PNecko;
 include protocol PSocketProcess;
 
 include NeckoChannelParams;
+using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
 
 namespace mozilla {
 namespace net {
 
 async protocol PWebrtcProxyChannel
 {
   manager PNecko or PSocketProcess;
 
 parent:
   async AsyncOpen(nsCString aHost,
                   int32_t aPort,
-                  LoadInfoArgs? aLoadInfoArgs,
+                  LoadInfoArgs aLoadInfoArgs,
                   nsCString aAlpn);
   async Write(uint8_t[] aWriteData);
   async Close();
 
 child:
   async OnClose(nsresult aReason);
   async OnConnected();
   async OnRead(uint8_t[] aReadData);
--- a/media/mtransport/ipc/WebrtcProxyChannel.cpp
+++ b/media/mtransport/ipc/WebrtcProxyChannel.cpp
@@ -12,16 +12,18 @@
 #include "nsIContentPolicy.h"
 #include "nsIEventTarget.h"
 #include "nsIIOService.h"
 #include "nsILoadInfo.h"
 #include "nsIProtocolProxyService.h"
 #include "nsIURIMutator.h"
 #include "nsProxyRelease.h"
 #include "nsString.h"
+#include "mozilla/dom/ContentProcessManager.h"
+#include "mozilla/dom/BrowserParent.h"
 
 #include "WebrtcProxyChannelCallback.h"
 #include "WebrtcProxyLog.h"
 
 namespace mozilla {
 namespace net {
 
 class WebrtcProxyData {
@@ -38,23 +40,22 @@ class WebrtcProxyData {
   nsTArray<uint8_t> mData;
 };
 
 NS_IMPL_ISUPPORTS(WebrtcProxyChannel, nsIAuthPromptProvider,
                   nsIHttpUpgradeListener, nsIInputStreamCallback,
                   nsIInterfaceRequestor, nsIOutputStreamCallback,
                   nsIRequestObserver, nsIStreamListener)
 
-WebrtcProxyChannel::WebrtcProxyChannel(nsIAuthPromptProvider* aAuthProvider,
-                                       WebrtcProxyChannelCallback* aCallbacks)
+WebrtcProxyChannel::WebrtcProxyChannel(WebrtcProxyChannelCallback* aCallbacks)
     : mProxyCallbacks(aCallbacks),
       mClosed(false),
       mOpened(false),
       mWriteOffset(0),
-      mAuthProvider(aAuthProvider),
+      mAuthProvider(nullptr),
       mTransport(nullptr),
       mSocketIn(nullptr),
       mSocketOut(nullptr) {
   LOG(("WebrtcProxyChannel::WebrtcProxyChannel %p\n", this));
   mMainThread = GetMainThreadEventTarget();
   mSocketThread = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID);
   MOZ_RELEASE_ASSERT(mMainThread, "no main thread");
   MOZ_RELEASE_ASSERT(mSocketThread, "no socket thread");
@@ -62,16 +63,22 @@ WebrtcProxyChannel::WebrtcProxyChannel(n
 
 WebrtcProxyChannel::~WebrtcProxyChannel() {
   LOG(("WebrtcProxyChannel::~WebrtcProxyChannel %p\n", this));
 
   NS_ProxyRelease("WebrtcProxyChannel::CleanUpAuthProvider", mMainThread,
                   mAuthProvider.forget());
 }
 
+void WebrtcProxyChannel::SetTabId(dom::TabId aTabId) {
+  dom::ContentProcessManager* cpm = dom::ContentProcessManager::GetSingleton();
+  dom::ContentParentId cpId = cpm->GetTabProcessId(aTabId);
+  mAuthProvider = cpm->GetBrowserParentByProcessAndTabId(cpId, aTabId);
+}
+
 nsresult WebrtcProxyChannel::Write(nsTArray<uint8_t>&& aWriteData) {
   LOG(("WebrtcProxyChannel::Write %p\n", this));
   MOZ_ALWAYS_SUCCEEDS(
       mSocketThread->Dispatch(NewRunnableMethod<nsTArray<uint8_t>&&>(
           "WebrtcProxyChannel::Write", this,
           &WebrtcProxyChannel::EnqueueWrite_s, std::move(aWriteData))));
 
   return NS_OK;
@@ -123,17 +130,17 @@ void WebrtcProxyChannel::CloseWithReason
   }
 
   NS_ProxyRelease("WebrtcProxyChannel::CleanUpAuthProvider", mMainThread,
                   mAuthProvider.forget());
   InvokeOnClose(aReason);
 }
 
 nsresult WebrtcProxyChannel::Open(const nsCString& aHost, const int& aPort,
-                                  nsILoadInfo* aLoadInfo,
+                                  const net::LoadInfoArgs& aArgs,
                                   const nsCString& aAlpn) {
   LOG(("WebrtcProxyChannel::AsyncOpen %p\n", this));
 
   if (mOpened) {
     LOG(("WebrtcProxyChannel %p: proxy channel already open\n", this));
     CloseWithReason(NS_ERROR_FAILURE);
     return NS_ERROR_FAILURE;
   }
@@ -158,27 +165,36 @@ nsresult WebrtcProxyChannel::Open(const 
   nsCOMPtr<nsIIOService> ioService;
   ioService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     LOG(("WebrtcProxyChannel %p: io service missing\n", this));
     CloseWithReason(rv);
     return rv;
   }
 
+  nsCOMPtr<nsILoadInfo> loadInfo;
+  Maybe<net::LoadInfoArgs> loadInfoArgs = Some(aArgs);
+  rv = LoadInfoArgsToLoadInfo(loadInfoArgs, getter_AddRefs(loadInfo));
+  if (NS_FAILED(rv)) {
+    LOG(("WebrtcProxyChannel %p: could not init load info\n", this));
+    CloseWithReason(rv);
+    return rv;
+  }
+
   // -need to always tunnel since we're using a proxy
   // -there shouldn't be an opportunity to send cookies, but explicitly disallow
   // them anyway.
   // -the previous proxy tunnel didn't support redirects e.g. 307. don't need to
   // introduce new behavior. can't follow redirects on connect anyway.
   nsCOMPtr<nsIChannel> localChannel;
   rv = ioService->NewChannelFromURIWithProxyFlags(
       uri, nullptr,
       // Proxy flags are overridden by SetConnectOnly()
-      0, aLoadInfo->LoadingNode(), aLoadInfo->LoadingPrincipal(),
-      aLoadInfo->TriggeringPrincipal(),
+      0, loadInfo->LoadingNode(), loadInfo->LoadingPrincipal(),
+      loadInfo->TriggeringPrincipal(),
       nsILoadInfo::SEC_DONT_FOLLOW_REDIRECTS | nsILoadInfo::SEC_COOKIES_OMIT |
           // We need this flag to allow loads from any origin since this channel
           // is being used to CONNECT to an HTTP proxy.
           nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
       nsIContentPolicy::TYPE_OTHER, getter_AddRefs(localChannel));
   if (NS_FAILED(rv)) {
     LOG(("WebrtcProxyChannel %p: bad open channel\n", this));
     CloseWithReason(rv);
--- a/media/mtransport/ipc/WebrtcProxyChannel.h
+++ b/media/mtransport/ipc/WebrtcProxyChannel.h
@@ -13,22 +13,23 @@
 #include "nsIAsyncInputStream.h"
 #include "nsIAsyncOutputStream.h"
 #include "nsIAuthPromptProvider.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIStreamListener.h"
 #include "nsStringFwd.h"
 #include "nsTArray.h"
+#include "mozilla/dom/ipc/IdType.h"  // TabId
 
-class nsILoadInfo;
 class nsISocketTransport;
 
 namespace mozilla {
 namespace net {
+class LoadInfoArgs;
 
 class WebrtcProxyChannelCallback;
 class WebrtcProxyData;
 
 class WebrtcProxyChannel : public nsIHttpUpgradeListener,
                            public nsIStreamListener,
                            public nsIInputStreamCallback,
                            public nsIOutputStreamCallback,
@@ -39,21 +40,21 @@ class WebrtcProxyChannel : public nsIHtt
   NS_DECL_NSIINPUTSTREAMCALLBACK
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSIOUTPUTSTREAMCALLBACK
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_FORWARD_SAFE_NSIAUTHPROMPTPROVIDER(mAuthProvider)
 
-  WebrtcProxyChannel(nsIAuthPromptProvider* aAuthProvider,
-                     WebrtcProxyChannelCallback* aProxyCallbacks);
+  explicit WebrtcProxyChannel(WebrtcProxyChannelCallback* aCallbacks);
 
+  void SetTabId(dom::TabId aTabId);
   nsresult Open(const nsCString& aHost, const int& aPort,
-                nsILoadInfo* aLoadInfo, const nsCString& aAlpn);
+                const net::LoadInfoArgs& aArgs, const nsCString& aAlpn);
   nsresult Write(nsTArray<uint8_t>&& aBytes);
   nsresult Close();
 
   size_t CountUnwrittenBytes() const;
 
  protected:
   virtual ~WebrtcProxyChannel();
 
--- a/media/mtransport/ipc/WebrtcProxyChannelChild.cpp
+++ b/media/mtransport/ipc/WebrtcProxyChannelChild.cpp
@@ -1,28 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WebrtcProxyChannelChild.h"
 
-#include "mozilla/dom/PBrowserOrId.h"
 #include "mozilla/net/NeckoChild.h"
+#include "mozilla/net/SocketProcessChild.h"
 
 #include "LoadInfo.h"
 
 #include "WebrtcProxyLog.h"
 #include "WebrtcProxyChannelCallback.h"
 
 using namespace mozilla::ipc;
 
-using mozilla::dom::PBrowserOrId;
-
 namespace mozilla {
 namespace net {
 
 mozilla::ipc::IPCResult WebrtcProxyChannelChild::RecvOnClose(
     const nsresult& aReason) {
   LOG(("WebrtcProxyChannelChild::RecvOnClose %p\n", this));
 
   MOZ_ASSERT(mProxyCallbacks, "webrtc proxy callbacks should be non-null");
@@ -62,32 +60,35 @@ WebrtcProxyChannelChild::WebrtcProxyChan
 WebrtcProxyChannelChild::~WebrtcProxyChannelChild() {
   MOZ_COUNT_DTOR(WebrtcProxyChannelChild);
 
   LOG(("WebrtcProxyChannelChild::~WebrtcProxyChannelChild %p\n", this));
 }
 
 void WebrtcProxyChannelChild::AsyncOpen(const nsCString& aHost,
                                         const int& aPort,
-                                        const PBrowserOrId& aBrowser,
-                                        nsIPrincipal* aLoadingPrincipal,
-                                        const nsCString& aAlpn) {
+                                        const net::LoadInfoArgs& aArgs,
+                                        const nsCString& aAlpn,
+                                        const dom::TabId& aTabId) {
   LOG(("WebrtcProxyChannelChild::AsyncOpen %p %s:%d\n", this, aHost.get(),
        aPort));
 
   MOZ_ASSERT(NS_IsMainThread(), "not main thread");
 
   AddIPDLReference();
 
-  gNeckoChild->SetEventTargetForActor(this, GetMainThreadEventTarget());
-  gNeckoChild->SendPWebrtcProxyChannelConstructor(this, aBrowser);
+  if (IsNeckoChild()) {
+    // We're on a content process
+    gNeckoChild->SetEventTargetForActor(this, GetMainThreadEventTarget());
+    gNeckoChild->SendPWebrtcProxyChannelConstructor(this, aTabId);
+  } else if (IsSocketProcessChild()) {
+    // We're on a socket process
+    SocketProcessChild::GetSingleton()->SetEventTargetForActor(
+        this, GetMainThreadEventTarget());
+    SocketProcessChild::GetSingleton()->SendPWebrtcProxyChannelConstructor(
+        this, aTabId);
+  }
 
-  nsCOMPtr<nsILoadInfo> loadInfo =
-      new LoadInfo(aLoadingPrincipal, nullptr, nullptr, 0, 0);
-
-  Maybe<LoadInfoArgs> loadInfoArgs;
-  MOZ_ALWAYS_SUCCEEDS(LoadInfoToLoadInfoArgs(loadInfo, &loadInfoArgs));
-
-  SendAsyncOpen(aHost, aPort, loadInfoArgs, aAlpn);
+  SendAsyncOpen(aHost, aPort, aArgs, aAlpn);
 }
 
 }  // namespace net
 }  // namespace mozilla
--- a/media/mtransport/ipc/WebrtcProxyChannelChild.h
+++ b/media/mtransport/ipc/WebrtcProxyChannelChild.h
@@ -3,23 +3,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_net_WebrtcProxyChannelChild_h
 #define mozilla_net_WebrtcProxyChannelChild_h
 
 #include "mozilla/net/PWebrtcProxyChannelChild.h"
+#include "mozilla/dom/ipc/IdType.h"
 
 namespace mozilla {
 
-namespace dom {
-class PBrowserOrId;
-}  // namespace dom
-
 namespace net {
 
 class WebrtcProxyChannelCallback;
 
 class WebrtcProxyChannelChild : public PWebrtcProxyChannelChild {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebrtcProxyChannelChild)
 
@@ -27,18 +24,18 @@ class WebrtcProxyChannelChild : public P
 
   mozilla::ipc::IPCResult RecvOnConnected() override;
 
   mozilla::ipc::IPCResult RecvOnRead(nsTArray<uint8_t>&& aReadData) override;
 
   explicit WebrtcProxyChannelChild(WebrtcProxyChannelCallback* aProxyCallbacks);
 
   void AsyncOpen(const nsCString& aHost, const int& aPort,
-                 const dom::PBrowserOrId& aBrowser,
-                 nsIPrincipal* aLoadingPrincipal, const nsCString& aAlpn);
+                 const net::LoadInfoArgs& aArgs, const nsCString& aAlpn,
+                 const dom::TabId& aTabId);
 
   void AddIPDLReference() { AddRef(); }
   void ReleaseIPDLReference() { Release(); }
 
  protected:
   virtual ~WebrtcProxyChannelChild();
 
   RefPtr<WebrtcProxyChannelCallback> mProxyCallbacks;
--- a/media/mtransport/ipc/WebrtcProxyChannelParent.cpp
+++ b/media/mtransport/ipc/WebrtcProxyChannelParent.cpp
@@ -13,34 +13,23 @@
 
 using namespace mozilla::dom;
 using namespace mozilla::ipc;
 
 namespace mozilla {
 namespace net {
 
 mozilla::ipc::IPCResult WebrtcProxyChannelParent::RecvAsyncOpen(
-    const nsCString& aHost, const int& aPort,
-    const Maybe<LoadInfoArgs>& aLoadInfoArgs, const nsCString& aAlpn) {
+    const nsCString& aHost, const int& aPort, const LoadInfoArgs& aLoadInfoArgs,
+    const nsCString& aAlpn) {
   LOG(("WebrtcProxyChannelParent::RecvAsyncOpen %p to %s:%d\n", this,
        aHost.get(), aPort));
 
-  nsresult rv;
-
-  nsCOMPtr<nsILoadInfo> loadInfo;
-
-  rv = LoadInfoArgsToLoadInfo(aLoadInfoArgs, getter_AddRefs(loadInfo));
-  if (NS_FAILED(rv)) {
-    IProtocol* mgr = Manager();
-    OnClose(rv);
-    return IPC_FAIL_NO_REASON(mgr);
-  }
-
   MOZ_ASSERT(mChannel, "webrtc proxy channel should be non-null");
-  mChannel->Open(aHost, aPort, loadInfo, aAlpn);
+  mChannel->Open(aHost, aPort, aLoadInfoArgs, aAlpn);
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult WebrtcProxyChannelParent::RecvWrite(
     nsTArray<uint8_t>&& aWriteData) {
   LOG(("WebrtcProxyChannelParent::RecvWrite %p for %zu\n", this,
        aWriteData.Length()));
@@ -67,23 +56,23 @@ mozilla::ipc::IPCResult WebrtcProxyChann
 }
 
 void WebrtcProxyChannelParent::ActorDestroy(ActorDestroyReason aWhy) {
   LOG(("WebrtcProxyChannelParent::ActorDestroy %p for %d\n", this, aWhy));
 
   CleanupChannel();
 }
 
-WebrtcProxyChannelParent::WebrtcProxyChannelParent(
-    nsIAuthPromptProvider* aAuthProvider) {
+WebrtcProxyChannelParent::WebrtcProxyChannelParent(dom::TabId aTabId) {
   MOZ_COUNT_CTOR(WebrtcProxyChannelParent);
 
   LOG(("WebrtcProxyChannelParent::WebrtcProxyChannelParent %p\n", this));
 
-  mChannel = new WebrtcProxyChannel(aAuthProvider, this);
+  mChannel = new WebrtcProxyChannel(this);
+  mChannel->SetTabId(aTabId);
 }
 
 WebrtcProxyChannelParent::~WebrtcProxyChannelParent() {
   MOZ_COUNT_DTOR(WebrtcProxyChannelParent);
 
   LOG(("WebrtcProxyChannelParent::~WebrtcProxyChannelParent %p\n", this));
 
   CleanupChannel();
--- a/media/mtransport/ipc/WebrtcProxyChannelParent.h
+++ b/media/mtransport/ipc/WebrtcProxyChannelParent.h
@@ -18,28 +18,28 @@ namespace net {
 
 class WebrtcProxyChannel;
 
 class WebrtcProxyChannelParent : public PWebrtcProxyChannelParent,
                                  public WebrtcProxyChannelCallback {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebrtcProxyChannelParent, override)
 
-  mozilla::ipc::IPCResult RecvAsyncOpen(
-      const nsCString& aHost, const int& aPort,
-      const Maybe<LoadInfoArgs>& aLoadInfoArgs,
-      const nsCString& aAlpn) override;
+  mozilla::ipc::IPCResult RecvAsyncOpen(const nsCString& aHost,
+                                        const int& aPort,
+                                        const LoadInfoArgs& aLoadInfoArgs,
+                                        const nsCString& aAlpn) override;
 
   mozilla::ipc::IPCResult RecvWrite(nsTArray<uint8_t>&& aWriteData) override;
 
   mozilla::ipc::IPCResult RecvClose() override;
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
 
-  explicit WebrtcProxyChannelParent(nsIAuthPromptProvider* aAuthProvider);
+  explicit WebrtcProxyChannelParent(dom::TabId aTabId);
 
   // WebrtcProxyChannelCallback
   void OnClose(nsresult aReason) override;
   void OnConnected() override;
   void OnRead(nsTArray<uint8_t>&& bytes) override;
 
   void AddIPDLReference() { AddRef(); }
   void ReleaseIPDLReference() { Release(); }
--- a/media/mtransport/nr_socket_proxy_config.cpp
+++ b/media/mtransport/nr_socket_proxy_config.cpp
@@ -1,36 +1,41 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nr_socket_proxy_config.h"
 
-#include "mozilla/dom/PBrowserOrId.h"
+#include "mozilla/dom/ipc/IdType.h"
+#include "mozilla/net/NeckoChannelParams.h"
 
 namespace mozilla {
 
 class NrSocketProxyConfig::Private {
  public:
-  dom::PBrowserOrId mBrowser;
+  uint64_t mTabId;
   nsCString mAlpn;
+  net::LoadInfoArgs mLoadInfoArgs;
 };
 
-NrSocketProxyConfig::NrSocketProxyConfig(const dom::PBrowserOrId& aBrowser,
-                                         const nsCString& aAlpn)
-    : mPrivate(new Private({aBrowser, aAlpn})) {}
+NrSocketProxyConfig::NrSocketProxyConfig(uint64_t aTabId,
+                                         const nsCString& aAlpn,
+                                         const net::LoadInfoArgs& aArgs)
+    : mPrivate(new Private({aTabId, aAlpn, aArgs})) {}
 
 NrSocketProxyConfig::NrSocketProxyConfig(NrSocketProxyConfig&& aOrig)
     : mPrivate(std::move(aOrig.mPrivate)) {}
 
 NrSocketProxyConfig::~NrSocketProxyConfig() {}
 
-const dom::PBrowserOrId& NrSocketProxyConfig::GetBrowser() const {
-  return mPrivate->mBrowser;
-}
+uint64_t NrSocketProxyConfig::GetTabId() const { return mPrivate->mTabId; }
 
 const nsCString& NrSocketProxyConfig::GetAlpn() const {
   return mPrivate->mAlpn;
 }
 
+const net::LoadInfoArgs& NrSocketProxyConfig::GetLoadInfoArgs() const {
+  return mPrivate->mLoadInfoArgs;
+}
+
 }  // namespace mozilla
--- a/media/mtransport/nr_socket_proxy_config.h
+++ b/media/mtransport/nr_socket_proxy_config.h
@@ -8,36 +8,37 @@
 #define nr_socket_proxy_config__
 
 #include <memory>
 #include "nsString.h"
 
 class nsIPrincipal;
 
 namespace mozilla {
-namespace dom {
-class PBrowserOrId;
+namespace net {
+class LoadInfoArgs;
 }
 
 class NrSocketProxyConfig {
  public:
-  NrSocketProxyConfig(const dom::PBrowserOrId& aBrowser,
-                      const nsCString& aAlpn);
+  NrSocketProxyConfig(uint64_t aTabId, const nsCString& aAlpn,
+                      const net::LoadInfoArgs& aArgs);
   // We need to actually write the default impl ourselves, because the compiler
   // needs to know how to destroy mPrivate in case an exception is thrown, even
   // though we disable exceptions in our build.
   NrSocketProxyConfig(NrSocketProxyConfig&& aOrig);
 
   ~NrSocketProxyConfig();
 
-  const dom::PBrowserOrId& GetBrowser() const;
+  uint64_t GetTabId() const;
   const nsCString& GetAlpn() const;
+  const net::LoadInfoArgs& GetLoadInfoArgs() const;
 
  private:
-  // PBrowserOrId includes stuff that conflicts with nICEr includes.
+  // LoadInfoArgs includes stuff that conflicts with nICEr includes.
   // Make it possible to include this header file without tripping over this
   // problem.
   class Private;
   std::unique_ptr<Private> mPrivate;
 };
 
 }  // namespace mozilla
 
--- a/media/mtransport/test/proxy_tunnel_socket_unittest.cpp
+++ b/media/mtransport/test/proxy_tunnel_socket_unittest.cpp
@@ -4,48 +4,45 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Original authors: ekr@rtfm.com; ryan@tokbox.com
 
 #include <vector>
 #include <numeric>
 
-#include "mozilla/dom/PBrowserOrId.h"
-
+#include "mozilla/net/NeckoChannelParams.h"
 #include "nr_socket_proxy.h"
 #include "nr_socket_proxy_config.h"
 #include "WebrtcProxyChannelWrapper.h"
 
 #define GTEST_HAS_RTTI 0
 #include "gtest/gtest.h"
 #include "gtest_utils.h"
 
 using namespace mozilla;
 
 // update TestReadMultipleSizes if you change this
 const std::string kHelloMessage = "HELLO IS IT ME YOU'RE LOOKING FOR?";
 
-typedef mozilla::dom::PBrowserOrId PBrowserOrId;
-
 class NrSocketProxyTest : public MtransportTest {
  public:
   NrSocketProxyTest()
       : mSProxy(nullptr),
         nr_socket_(nullptr),
         mEmptyArray(0),
         mReadChunkSize(0),
         mReadChunkSizeIncrement(1),
         mReadAllowance(-1),
         mConnected(false) {}
 
   void SetUp() override {
     nsCString alpn = NS_LITERAL_CSTRING("webrtc");
     std::shared_ptr<NrSocketProxyConfig> config;
-    config.reset(new NrSocketProxyConfig(PBrowserOrId(), alpn));
+    config.reset(new NrSocketProxyConfig(0, alpn, net::LoadInfoArgs()));
     // config is never used but must be non-null
     mSProxy = new NrSocketProxy(config);
     int r = nr_socket_create_int((void *)mSProxy.get(), mSProxy->vtbl(),
                                  &nr_socket_);
     ASSERT_EQ(0, r);
 
     // fake calling AsyncOpen() due to IPC calls. must be non-null
     mSProxy->AssignChannel_DoNotUse(new WebrtcProxyChannelWrapper(nullptr));
--- a/media/mtransport/test/webrtcproxychannel_unittest.cpp
+++ b/media/mtransport/test/webrtcproxychannel_unittest.cpp
@@ -449,17 +449,17 @@ const std::string WebrtcProxyChannelTest
   std::lock_guard<std::mutex> guard(mDataMutex);
   return std::string((char *)mData.Elements(), mData.Length());
 }
 
 // Fake as in not the real WebrtcProxyChannel but real enough
 class FakeWebrtcProxyChannel : public WebrtcProxyChannel {
  public:
   explicit FakeWebrtcProxyChannel(WebrtcProxyChannelCallback *aCallback)
-      : WebrtcProxyChannel(nullptr, aCallback) {}
+      : WebrtcProxyChannel(aCallback) {}
 
  protected:
   virtual ~FakeWebrtcProxyChannel() = default;
 
   void InvokeOnClose(nsresult aReason) override;
   void InvokeOnConnected() override;
   void InvokeOnRead(nsTArray<uint8_t> &&aReadData) override;
 };
--- a/media/webrtc/signaling/src/peerconnection/MediaTransportHandlerIPC.cpp
+++ b/media/webrtc/signaling/src/peerconnection/MediaTransportHandlerIPC.cpp
@@ -142,29 +142,27 @@ void MediaTransportHandlerIPC::Destroy()
       },
       [](const nsCString& aError) {});
 }
 
 // We will probably be able to move the proxy lookup stuff into
 // this class once we move mtransport to its own process.
 void MediaTransportHandlerIPC::SetProxyServer(
     NrSocketProxyConfig&& aProxyConfig) {
-  // TODO(bug 1521113): This doesn't work on IPC
-#if 0
   mInitPromise->Then(
       GetMainThreadSerialEventTarget(), __func__,
       [aProxyConfig = std::move(aProxyConfig), this,
        self = RefPtr<MediaTransportHandlerIPC>(this)](bool /*dummy*/) mutable {
         if (mChild) {
-          mChild->SendSetProxyServer(aProxyConfig.GetBrowser(),
+          mChild->SendSetProxyServer(dom::TabId(aProxyConfig.GetTabId()),
+                                     aProxyConfig.GetLoadInfoArgs(),
                                      aProxyConfig.GetAlpn());
         }
       },
       [](const nsCString& aError) {});
-#endif
 }
 
 void MediaTransportHandlerIPC::EnsureProvisionalTransport(
     const std::string& aTransportId, const std::string& aLocalUfrag,
     const std::string& aLocalPwd, size_t aComponentCount) {
   mInitPromise->Then(
       GetMainThreadSerialEventTarget(), __func__,
       [=, self = RefPtr<MediaTransportHandlerIPC>(this)](bool /*dummy*/) {
--- a/media/webrtc/signaling/src/peerconnection/MediaTransportParent.cpp
+++ b/media/webrtc/signaling/src/peerconnection/MediaTransportParent.cpp
@@ -156,19 +156,20 @@ mozilla::ipc::IPCResult MediaTransportPa
   if (NS_FAILED(rv)) {
     return ipc::IPCResult::Fail(WrapNotNull(this), __func__,
                                 "MediaTransportHandler::Init failed");
   }
   return ipc::IPCResult::Ok();
 }
 
 mozilla::ipc::IPCResult MediaTransportParent::RecvSetProxyServer(
-    const PBrowserOrId& browserOrId, const nsCString& alpn) {
+    const dom::TabId& tabId, const net::LoadInfoArgs& args,
+    const nsCString& alpn) {
   MOZ_ASSERT(GetMainThreadEventTarget()->IsOnCurrentThread());
-  mImpl->mHandler->SetProxyServer(NrSocketProxyConfig(browserOrId, alpn));
+  mImpl->mHandler->SetProxyServer(NrSocketProxyConfig(tabId, alpn, args));
   return ipc::IPCResult::Ok();
 }
 
 mozilla::ipc::IPCResult MediaTransportParent::RecvEnsureProvisionalTransport(
     const string& transportId, const string& localUfrag, const string& localPwd,
     const int& componentCount) {
   MOZ_ASSERT(GetMainThreadEventTarget()->IsOnCurrentThread());
   mImpl->mHandler->EnsureProvisionalTransport(transportId, localUfrag, localPwd,
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -17,21 +17,21 @@
 #include "nsIURI.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsICancelable.h"
 #include "nsILoadInfo.h"
 #include "nsIContentPolicy.h"
 #include "nsIProxyInfo.h"
 #include "nsIProtocolProxyService.h"
 #include "nsIPrincipal.h"
+#include "mozilla/LoadInfo.h"
 #include "nsProxyRelease.h"
 
 #include "nsIScriptGlobalObject.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/dom/PBrowserOrId.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "MediaManager.h"
 #include "WebrtcGmpVideoCodec.h"
 
 namespace mozilla {
 using namespace dom;
 
 static const char* pcmLogTag = "PeerConnectionMedia";
@@ -61,18 +61,29 @@ NS_IMETHODIMP PeerConnectionMedia::Proto
   return NS_OK;
 }
 
 void PeerConnectionMedia::ProtocolProxyQueryHandler::SetProxyOnPcm(
     nsIProxyInfo& proxyinfo) {
   CSFLogInfo(LOGTAG, "%s: Had proxyinfo", __FUNCTION__);
 
   nsCString alpn = NS_LITERAL_CSTRING("webrtc,c-webrtc");
-  PBrowserOrId browser = BrowserChild::GetFrom(pcm_->GetWindow());
-  pcm_->mProxyConfig.reset(new NrSocketProxyConfig(browser, alpn));
+  auto browserChild = BrowserChild::GetFrom(pcm_->GetWindow());
+  if (!browserChild) {
+    // Android doesn't have browser child apparently...
+    return;
+  }
+  TabId id = browserChild->GetTabId();
+  nsCOMPtr<nsILoadInfo> loadInfo = new net::LoadInfo(
+      nsContentUtils::GetSystemPrincipal(), nullptr, nullptr, 0, 0);
+
+  Maybe<net::LoadInfoArgs> loadInfoArgs;
+  MOZ_ALWAYS_SUCCEEDS(
+      mozilla::ipc::LoadInfoToLoadInfoArgs(loadInfo, &loadInfoArgs));
+  pcm_->mProxyConfig.reset(new NrSocketProxyConfig(id, alpn, *loadInfoArgs));
 }
 
 NS_IMPL_ISUPPORTS(PeerConnectionMedia::ProtocolProxyQueryHandler,
                   nsIProtocolProxyCallback)
 
 void PeerConnectionMedia::StunAddrsHandler::OnStunAddrsAvailable(
     const mozilla::net::NrIceStunAddrArray& addrs) {
   CSFLogInfo(LOGTAG, "%s: receiving (%d) stun addrs", __FUNCTION__,
--- a/netwerk/ipc/NeckoChild.cpp
+++ b/netwerk/ipc/NeckoChild.cpp
@@ -103,17 +103,17 @@ bool NeckoChild::DeallocPStunAddrsReques
 #ifdef MOZ_WEBRTC
   StunAddrsRequestChild* p = static_cast<StunAddrsRequestChild*>(aActor);
   p->ReleaseIPDLReference();
 #endif
   return true;
 }
 
 PWebrtcProxyChannelChild* NeckoChild::AllocPWebrtcProxyChannelChild(
-    const PBrowserOrId& browser) {
+    const TabId& tabId) {
   // We don't allocate here: instead we always use IPDL constructor that takes
   // an existing object
   MOZ_ASSERT_UNREACHABLE(
       "AllocPWebrtcProxyChannelChild should not be called on"
       " child");
   return nullptr;
 }
 
--- a/netwerk/ipc/NeckoChild.h
+++ b/netwerk/ipc/NeckoChild.h
@@ -28,18 +28,17 @@ class NeckoChild : public PNeckoChild {
   PHttpChannelChild* AllocPHttpChannelChild(
       const PBrowserOrId&, const SerializedLoadContext&,
       const HttpChannelCreationArgs& aOpenArgs);
   bool DeallocPHttpChannelChild(PHttpChannelChild*);
 
   PStunAddrsRequestChild* AllocPStunAddrsRequestChild();
   bool DeallocPStunAddrsRequestChild(PStunAddrsRequestChild* aActor);
 
-  PWebrtcProxyChannelChild* AllocPWebrtcProxyChannelChild(
-      const PBrowserOrId& browser);
+  PWebrtcProxyChannelChild* AllocPWebrtcProxyChannelChild(const TabId& tabId);
   bool DeallocPWebrtcProxyChannelChild(PWebrtcProxyChannelChild* aActor);
 
   PAltDataOutputStreamChild* AllocPAltDataOutputStreamChild(
       const nsCString& type, const int64_t& predictedSize,
       PHttpChannelChild* channel);
   bool DeallocPAltDataOutputStreamChild(PAltDataOutputStreamChild* aActor);
 
   PCookieServiceChild* AllocPCookieServiceChild();
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -326,21 +326,19 @@ bool NeckoParent::DeallocPStunAddrsReque
 #ifdef MOZ_WEBRTC
   StunAddrsRequestParent* p = static_cast<StunAddrsRequestParent*>(aActor);
   p->Release();
 #endif
   return true;
 }
 
 PWebrtcProxyChannelParent* NeckoParent::AllocPWebrtcProxyChannelParent(
-    const PBrowserOrId& aBrowser) {
+    const TabId& aTabId) {
 #ifdef MOZ_WEBRTC
-  RefPtr<BrowserParent> tab =
-      BrowserParent::GetFrom(aBrowser.get_PBrowserParent());
-  WebrtcProxyChannelParent* parent = new WebrtcProxyChannelParent(tab);
+  WebrtcProxyChannelParent* parent = new WebrtcProxyChannelParent(aTabId);
   parent->AddRef();
   return parent;
 #else
   return nullptr;
 #endif
 }
 
 bool NeckoParent::DeallocPWebrtcProxyChannelParent(
--- a/netwerk/ipc/NeckoParent.h
+++ b/netwerk/ipc/NeckoParent.h
@@ -99,17 +99,17 @@ class NeckoParent : public PNeckoParent 
       const SerializedLoadContext& aSerialized,
       const HttpChannelCreationArgs& aOpenArgs) override;
   bool DeallocPHttpChannelParent(PHttpChannelParent*);
 
   PStunAddrsRequestParent* AllocPStunAddrsRequestParent();
   bool DeallocPStunAddrsRequestParent(PStunAddrsRequestParent* aActor);
 
   PWebrtcProxyChannelParent* AllocPWebrtcProxyChannelParent(
-      const PBrowserOrId& aBrowser);
+      const TabId& aTabId);
   bool DeallocPWebrtcProxyChannelParent(PWebrtcProxyChannelParent* aActor);
 
   PAltDataOutputStreamParent* AllocPAltDataOutputStreamParent(
       const nsCString& type, const int64_t& predictedSize,
       PHttpChannelParent* channel);
   bool DeallocPAltDataOutputStreamParent(PAltDataOutputStreamParent* aActor);
 
   bool DeallocPCookieServiceParent(PCookieServiceParent*);
--- a/netwerk/ipc/PNecko.ipdl
+++ b/netwerk/ipc/PNecko.ipdl
@@ -129,17 +129,17 @@ parent:
   async RequestContextLoadBegin(uint64_t rcid);
   async RequestContextAfterDOMContentLoaded(uint64_t rcid);
   async RemoveRequestContext(uint64_t rcid);
 
   async PAltDataOutputStream(nsCString type, int64_t predictedSize, PHttpChannel channel);
 
   async PStunAddrsRequest();
 
-  async PWebrtcProxyChannel(PBrowserOrId browser);
+  async PWebrtcProxyChannel(TabId tabId);
 
   /**
    * WebExtension-specific remote resource loading
    */
   async GetExtensionStream(URIParams uri) returns (nsIInputStream stream);
   async GetExtensionFD(URIParams uri) returns (FileDescriptor fd);
 
   async InitSocketProcessBridge()
--- a/netwerk/ipc/PSocketProcess.ipdl
+++ b/netwerk/ipc/PSocketProcess.ipdl
@@ -34,17 +34,17 @@ parent:
   // Messages for sending telemetry to parent process.
   async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
   async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
   async UpdateChildScalars(ScalarAction[] actions);
   async UpdateChildKeyedScalars(KeyedScalarAction[] actions);
   async RecordChildEvents(ChildEventData[] events);
   async RecordDiscardedData(DiscardedData data);
 
-  async PWebrtcProxyChannel(PBrowserOrId browser);
+  async PWebrtcProxyChannel(TabId tabId);
 
 child:
   async PreferenceUpdate(Pref pref);
   async RequestMemoryReport(uint32_t generation,
                             bool anonymize,
                             bool minimizeMemoryUsage,
                             FileDescriptor? DMDFile);
   async SetOffline(bool offline);
--- a/netwerk/ipc/SocketProcessParent.cpp
+++ b/netwerk/ipc/SocketProcessParent.cpp
@@ -128,33 +128,19 @@ mozilla::ipc::IPCResult SocketProcessPar
 mozilla::ipc::IPCResult SocketProcessParent::RecvRecordDiscardedData(
     const mozilla::Telemetry::DiscardedData& aDiscardedData) {
   TelemetryIPC::RecordDiscardedData(Telemetry::ProcessID::Socket,
                                     aDiscardedData);
   return IPC_OK();
 }
 
 PWebrtcProxyChannelParent* SocketProcessParent::AllocPWebrtcProxyChannelParent(
-    const PBrowserOrId& aBrowser) {
+    const TabId& aTabId) {
 #ifdef MOZ_WEBRTC
-  if (aBrowser.type() != PBrowserOrId::TTabId) {
-    MOZ_ASSERT(false, "We only allow TabId here.");
-    return nullptr;
-  }
-
-  dom::ContentProcessManager* cpm = dom::ContentProcessManager::GetSingleton();
-  dom::TabId tabId = aBrowser.get_TabId();
-  dom::ContentParentId cpId = cpm->GetTabProcessId(tabId);
-  RefPtr<dom::BrowserParent> tab = cpm->GetBrowserParentByProcessAndTabId(cpId, tabId);
-  if (!tab) {
-    MOZ_ASSERT(false, "Cannot find the BrowserParent!");
-    return nullptr;
-  }
-
-  WebrtcProxyChannelParent* parent = new WebrtcProxyChannelParent(tab);
+  WebrtcProxyChannelParent* parent = new WebrtcProxyChannelParent(aTabId);
   parent->AddRef();
   return parent;
 #else
   return nullptr;
 #endif
 }
 
 bool SocketProcessParent::DeallocPWebrtcProxyChannelParent(
--- a/netwerk/ipc/SocketProcessParent.h
+++ b/netwerk/ipc/SocketProcessParent.h
@@ -48,17 +48,17 @@ class SocketProcessParent final : public
   mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(
       InfallibleTArray<KeyedScalarAction>&& aScalarActions);
   mozilla::ipc::IPCResult RecvRecordChildEvents(
       nsTArray<ChildEventData>&& events);
   mozilla::ipc::IPCResult RecvRecordDiscardedData(
       const DiscardedData& aDiscardedData);
 
   PWebrtcProxyChannelParent* AllocPWebrtcProxyChannelParent(
-      const PBrowserOrId& aBrowser);
+      const TabId& aTabId);
   bool DeallocPWebrtcProxyChannelParent(PWebrtcProxyChannelParent* aActor);
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
   bool SendRequestMemoryReport(const uint32_t& aGeneration,
                                const bool& aAnonymize,
                                const bool& aMinimizeMemoryUsage,
                                const Maybe<ipc::FileDescriptor>& aDMDFile);