Bug 1312304: Remove ICE policy "none". r=drno r=smaug a=gchang
authorByron Campen [:bwc] <docfaraday@gmail.com>
Mon, 24 Oct 2016 13:36:56 -0500
changeset 358559 245d3d9c8c22a481d0cc66bd9ff0fc18ab12fc49
parent 358558 731b05e7657b36872435286468a7721c5ea41718
child 358560 1d9abc42d471f2789da4c9d470d00517f98db365
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno, smaug, gchang
bugs1312304
milestone51.0a2
Bug 1312304: Remove ICE policy "none". r=drno r=smaug a=gchang MozReview-Commit-ID: 2adsRJ6pFnD
dom/webidl/RTCConfiguration.webidl
media/mtransport/nricectx.cpp
media/mtransport/nricectx.h
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/dom/webidl/RTCConfiguration.webidl
+++ b/dom/webidl/RTCConfiguration.webidl
@@ -16,17 +16,16 @@ dictionary RTCIceServer {
     (DOMString or sequence<DOMString>) urls;
     DOMString  url; //deprecated
     DOMString username;
     DOMString credential;
     RTCIceCredentialType credentialType = "password";
 };
 
 enum RTCIceTransportPolicy {
-    "none",
     "relay",
     "all"
 };
 
 enum RTCBundlePolicy {
     "balanced",
     "max-compat",
     "max-bundle"
--- a/media/mtransport/nricectx.cpp
+++ b/media/mtransport/nricectx.cpp
@@ -530,19 +530,16 @@ NrIceCtx::Initialize(const std::string& 
 
   // Create the ICE context
   int r;
 
   UINT4 flags = offerer_ ? NR_ICE_CTX_FLAGS_OFFERER:
       NR_ICE_CTX_FLAGS_ANSWERER;
   flags |= NR_ICE_CTX_FLAGS_AGGRESSIVE_NOMINATION;
   switch (policy_) {
-    case ICE_POLICY_NONE:
-      MOZ_CRASH();
-      break;
     case ICE_POLICY_RELAY:
       flags |= NR_ICE_CTX_FLAGS_RELAY_ONLY;
       break;
     case ICE_POLICY_NO_HOST:
       flags |= NR_ICE_CTX_FLAGS_HIDE_HOST_CANDIDATES;
       break;
     case ICE_POLICY_ALL:
       break;
@@ -832,19 +829,16 @@ abort:
     nr_socket_wrapper_factory_destroy(&wrapper);
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
 nsresult NrIceCtx::StartGathering(bool default_route_only, bool proxy_only) {
   ASSERT_ON_THREAD(sts_target_);
-  if (policy_ == ICE_POLICY_NONE) {
-    return NS_OK;
-  }
   SetGatheringState(ICE_CTX_GATHER_STARTED);
 
   if (default_route_only) {
     nr_ice_ctx_add_flags(ctx_, NR_ICE_CTX_FLAGS_ONLY_DEFAULT_ADDRS);
   } else {
     nr_ice_ctx_remove_flags(ctx_, NR_ICE_CTX_FLAGS_ONLY_DEFAULT_ADDRS);
   }
 
@@ -922,21 +916,16 @@ nsresult NrIceCtx::ParseGlobalAttributes
   }
 
   return NS_OK;
 }
 
 nsresult NrIceCtx::StartChecks() {
   int r;
 
-  if (policy_ == ICE_POLICY_NONE) {
-    MOZ_MTLOG(ML_ERROR, "Couldn't start peer checks because policy == none");
-    SetConnectionState(ICE_CTX_FAILED);
-    return NS_ERROR_FAILURE;
-  }
   r=nr_ice_peer_ctx_pair_candidates(peer_);
   if (r) {
     MOZ_MTLOG(ML_ERROR, "Couldn't pair candidates on "
               << name_ << "'");
     SetConnectionState(ICE_CTX_FAILED);
     return NS_ERROR_FAILURE;
   }
 
--- a/media/mtransport/nricectx.h
+++ b/media/mtransport/nricectx.h
@@ -204,18 +204,17 @@ class NrIceCtx {
                         ICE_CTX_GATHER_STARTED,
                         ICE_CTX_GATHER_COMPLETE
   };
 
   enum Controlling { ICE_CONTROLLING,
                      ICE_CONTROLLED
   };
 
-  enum Policy { ICE_POLICY_NONE,
-                ICE_POLICY_RELAY,
+  enum Policy { ICE_POLICY_RELAY,
                 ICE_POLICY_NO_HOST,
                 ICE_POLICY_ALL
   };
 
   // initialize ICE globals, crypto, and logging
   static void InitializeGlobals(bool allow_loopback = false,
                                 bool tcp_enabled = true,
                                 bool allow_link_local = false);
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -470,19 +470,16 @@ PeerConnectionConfiguration::Init(const 
     case dom::RTCBundlePolicy::Max_bundle:
       setBundlePolicy(kBundleMaxBundle);
       break;
     default:
       MOZ_CRASH();
   }
 
   switch (aSrc.mIceTransportPolicy) {
-    case dom::RTCIceTransportPolicy::None:
-      setIceTransportPolicy(NrIceCtx::ICE_POLICY_NONE);
-      break;
     case dom::RTCIceTransportPolicy::Relay:
       setIceTransportPolicy(NrIceCtx::ICE_POLICY_RELAY);
       break;
     case dom::RTCIceTransportPolicy::All:
       if (Preferences::GetBool("media.peerconnection.ice.no_host", false)) {
         setIceTransportPolicy(NrIceCtx::ICE_POLICY_NO_HOST);
       } else {
         setIceTransportPolicy(NrIceCtx::ICE_POLICY_ALL);