Bug 1545827: Use NrSocketProxy on the socket process, when appropriate. r=mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 26 Apr 2019 14:46:34 +0000
changeset 471496 43f6ce8cb91b45fc8bf361d91d8b61d3dd3e0050
parent 471495 7ed63d730876b816eb7b91419763208951663a36
child 471497 93e934e867c5955fe22d8c5baf19a805a4317ea1
push id35920
push useraiakab@mozilla.com
push dateFri, 26 Apr 2019 22:02:33 +0000
treeherdermozilla-central@b13f2b24ae62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
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 NrSocketProxy on the socket process, when appropriate. r=mjf Differential Revision: https://phabricator.services.mozilla.com/D28665
media/mtransport/nr_socket_prsock.cpp
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -2093,18 +2093,24 @@ int NrSocketBase::CreateSocket(
     const std::shared_ptr<NrSocketProxyConfig> &config) {
   int r, _status;
 
   if (IsForbiddenAddress(addr)) {
     ABORT(R_REJECTED);
   }
 
   // create IPC bridge for content process
-  if (XRE_IsParentProcess() || XRE_IsSocketProcess()) {
+  if (XRE_IsParentProcess()) {
     *sock = new NrSocket();
+  } else if (XRE_IsSocketProcess()) {
+    if (addr->protocol == IPPROTO_TCP && config) {
+      *sock = new NrSocketProxy(config);
+    } else {
+      *sock = new NrSocket();
+    }
   } else {
     switch (addr->protocol) {
       case IPPROTO_UDP:
         *sock = new NrUdpSocketIpc();
         break;
       case IPPROTO_TCP:
 #if defined(MOZILLA_INTERNAL_API)
         if (!config) {