Backed out 3 changesets (bug 1641600) for failures at test_peerConnection_constructedStream.html. CLOSED TREE

Backed out changeset 41a85b7d3e5e (bug 1641600)
Backed out changeset 249782af96bb (bug 1641600)
Backed out changeset 86c2932e66d3 (bug 1641600)
This commit is contained in:
Butkovits Atila 2020-06-04 15:06:33 +03:00
Родитель af5e269215
Коммит 8257764785
9 изменённых файлов: 87 добавлений и 113 удалений

Просмотреть файл

@ -207,16 +207,10 @@ class JsepSession {
}
}
// See Bug 1642419, this can be removed when all sites are working with RTX.
void SetRtxIsAllowed(bool aRtxIsAllowed) { mRtxIsAllowed = aRtxIsAllowed; }
protected:
const std::string mName;
JsepSignalingState mState;
uint32_t mNegotiations;
// See Bug 1642419, this can be removed when all sites are working with RTX.
bool mRtxIsAllowed = true;
};
} // namespace mozilla

Просмотреть файл

@ -407,8 +407,7 @@ std::vector<SdpExtmapAttributeList::Extmap> JsepSessionImpl::GetRtpExtensions(
AddVideoRtpExtension(webrtc::RtpExtension::kRtpStreamIdUri,
SdpDirectionAttribute::kSendonly);
if (mRtxIsAllowed &&
Preferences::GetBool("media.peerconnection.video.use_rtx", false)) {
if (Preferences::GetBool("media.peerconnection.video.use_rtx", false)) {
AddVideoRtpExtension(webrtc::RtpExtension::kRepairedRtpStreamIdUri,
SdpDirectionAttribute::kSendonly);
}
@ -1950,7 +1949,6 @@ void JsepSessionImpl::SetupDefaultCodecs() {
new JsepAudioCodecDescription("101", "telephone-event", 8000, 1));
bool useRtx =
mRtxIsAllowed &&
Preferences::GetBool("media.peerconnection.video.use_rtx", false);
// Supported video codecs.
// Note: order here implies priority for building offers!

Просмотреть файл

@ -451,7 +451,6 @@ std::vector<UniquePtr<JsepCodecDescription>> JsepTrack::NegotiateCodecs(
JsepVideoCodecDescription* cloneVideoCodec =
static_cast<JsepVideoCodecDescription*>(clone.get());
bool useRtx =
mRtxIsAllowed &&
Preferences::GetBool("media.peerconnection.video.use_rtx", false);
videoCodec->mRtxEnabled = useRtx && cloneVideoCodec->mRtxEnabled;
videoCodec->mRtxPayloadType = cloneVideoCodec->mRtxPayloadType;

Просмотреть файл

@ -198,8 +198,7 @@ class JsepTrack {
virtual std::vector<uint32_t> GetRtxSsrcs() const {
std::vector<uint32_t> result;
if (mRtxIsAllowed &&
Preferences::GetBool("media.peerconnection.video.use_rtx", false)) {
if (Preferences::GetBool("media.peerconnection.video.use_rtx", false)) {
std::for_each(
mSsrcToRtxSsrc.begin(), mSsrcToRtxSsrc.end(),
[&result](const auto& pair) { result.push_back(pair.second); });
@ -279,9 +278,6 @@ class JsepTrack {
sdp::Direction direction, SsrcGenerator& ssrcGenerator,
bool requireRtxSsrcs, SdpMediaSection* msection);
// See Bug 1642419, this can be removed when all sites are working with RTX.
void SetRtxIsAllowed(bool aRtxIsAllowed) { mRtxIsAllowed = aRtxIsAllowed; }
private:
std::vector<UniquePtr<JsepCodecDescription>> GetCodecClones() const;
static void EnsureNoDuplicatePayloadTypes(
@ -329,9 +325,6 @@ class JsepTrack {
std::map<uint32_t, uint32_t> mSsrcToRtxSsrc;
bool mActive;
bool mRemoteSetSendBit;
// See Bug 1642419, this can be removed when all sites are working with RTX.
bool mRtxIsAllowed = true;
};
} // namespace mozilla

Просмотреть файл

@ -177,12 +177,6 @@ class JsepTransceiver {
return false;
}
// See Bug 1642419, this can be removed when all sites are working with RTX.
void SetRtxIsAllowed(bool aRtxIsAllowed) {
mSendTrack.SetRtxIsAllowed(aRtxIsAllowed);
mRecvTrack.SetRtxIsAllowed(aRtxIsAllowed);
}
// This is the direction JS wants. It might not actually happen.
SdpDirectionAttribute::Direction mJsDirection;

Просмотреть файл

@ -19,7 +19,6 @@
#include "pk11pub.h"
#include "nsNetCID.h"
#include "nsIIDNService.h"
#include "nsILoadContext.h"
#include "nsServiceManagerUtils.h"
#include "nsThreadUtils.h"
@ -322,10 +321,6 @@ PeerConnectionImpl::PeerConnectionImpl(const GlobalObject* aGlobal)
}
mWindow->AddPeerConnection();
mActiveOnWindow = true;
mRtxIsAllowed =
!HostnameInPref("media.peerconnection.video.use_rtx.blocklist",
mWindow->GetDocumentURI());
}
CSFLogInfo(LOGTAG, "%s: PeerConnectionImpl constructor for %s", __FUNCTION__,
mHandle.c_str());
@ -473,7 +468,6 @@ nsresult PeerConnectionImpl::Initialize(PeerConnectionObserver& aObserver,
mJsepSession =
MakeUnique<JsepSessionImpl>(mName, MakeUnique<PCUuidGenerator>());
mJsepSession->SetRtxIsAllowed(mRtxIsAllowed);
res = mJsepSession->Init();
if (NS_FAILED(res)) {
@ -1032,8 +1026,6 @@ already_AddRefed<TransceiverImpl> PeerConnectionImpl::CreateTransceiverImpl(
return nullptr;
}
jsepTransceiver->SetRtxIsAllowed(mRtxIsAllowed);
// Do this last, since it is not possible to roll back.
nsresult rv = AddRtpTransceiverToJsepSession(jsepTransceiver);
if (NS_FAILED(rv)) {
@ -1706,73 +1698,6 @@ void PeerConnectionImpl::DumpPacket_m(size_t level, dom::mozPacketDumpType type,
mPCObserver->OnPacket(level, type, sending, arrayBuffer, jrv);
}
bool PeerConnectionImpl::HostnameInPref(const char* aPref, nsIURI* aDocURI) {
auto HostInDomain = [](const nsCString& aHost, const nsCString& aPattern) {
int32_t patternOffset = 0;
int32_t hostOffset = 0;
// Act on '*.' wildcard in the left-most position in a domain pattern.
if (StringBeginsWith(aPattern, nsCString("*."))) {
patternOffset = 2;
// Ignore the lowest level sub-domain for the hostname.
hostOffset = aHost.FindChar('.') + 1;
if (hostOffset <= 1) {
// Reject a match between a wildcard and a TLD or '.foo' form.
return false;
}
}
nsDependentCString hostRoot(aHost, hostOffset);
return hostRoot.EqualsIgnoreCase(aPattern.BeginReading() + patternOffset);
};
if (!aDocURI) {
return false;
}
nsCString hostName;
aDocURI->GetAsciiHost(hostName); // normalize UTF8 to ASCII equivalent
nsCString domainList;
nsresult nr = Preferences::GetCString(aPref, domainList);
if (NS_FAILED(nr)) {
return false;
}
domainList.StripWhitespace();
if (domainList.IsEmpty() || hostName.IsEmpty()) {
return false;
}
// Get UTF8 to ASCII domain name normalization service
nsresult rv;
nsCOMPtr<nsIIDNService> idnService =
do_GetService("@mozilla.org/network/idn-service;1", &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
// Test each domain name in the comma separated list
// after converting from UTF8 to ASCII. Each domain
// must match exactly or have a single leading '*.' wildcard.
for (const nsACString& each : domainList.Split(',')) {
nsCString domainName;
rv = idnService->ConvertUTF8toACE(each, domainName);
if (NS_SUCCEEDED(rv)) {
if (HostInDomain(hostName, domainName)) {
return true;
}
} else {
NS_WARNING("Failed to convert UTF-8 host to ASCII");
}
}
return false;
}
nsresult PeerConnectionImpl::EnablePacketDump(unsigned long level,
dom::mozPacketDumpType type,
bool sending) {

Просмотреть файл

@ -441,11 +441,6 @@ class PeerConnectionImpl final
return mTimestampMaker;
}
// Utility function, given a string pref and an URI, returns whether or not
// the URI occurs in the pref. Wildcards are supported (e.g. *.example.com)
// and multiple hostnames can be present, separated by commas.
static bool HostnameInPref(const char* aPrefList, nsIURI* aDocURI);
private:
virtual ~PeerConnectionImpl();
PeerConnectionImpl(const PeerConnectionImpl& rhs);
@ -614,9 +609,6 @@ class PeerConnectionImpl final
DOMMediaStream* GetReceiveStream(const std::string& aId) const;
DOMMediaStream* CreateReceiveStream(const std::string& aId);
// See Bug 1642419, this can be removed when all sites are working with RTX.
bool mRtxIsAllowed = true;
public:
// these are temporary until the DataChannel Listen/Connect API is removed
unsigned short listenPort;

Просмотреть файл

@ -328,6 +328,88 @@ bool PeerConnectionMedia::GetPrefDefaultAddressOnly() const {
return default_address_only;
}
static bool HostInDomain(const nsCString& aHost, const nsCString& aPattern) {
int32_t patternOffset = 0;
int32_t hostOffset = 0;
// Act on '*.' wildcard in the left-most position in a domain pattern.
if (aPattern.Length() > 2 && aPattern[0] == '*' && aPattern[1] == '.') {
patternOffset = 2;
// Ignore the lowest level sub-domain for the hostname.
hostOffset = aHost.FindChar('.') + 1;
if (hostOffset <= 1) {
// Reject a match between a wildcard and a TLD or '.foo' form.
return false;
}
}
nsDependentCString hostRoot(aHost, hostOffset);
return hostRoot.EqualsIgnoreCase(aPattern.BeginReading() + patternOffset);
}
static bool HostInObfuscationWhitelist(nsIURI* docURI) {
if (!docURI) {
return false;
}
nsCString hostName;
docURI->GetAsciiHost(hostName); // normalize UTF8 to ASCII equivalent
nsCString domainWhiteList;
nsresult nr = Preferences::GetCString(
"media.peerconnection.ice.obfuscate_host_addresses.whitelist",
domainWhiteList);
if (NS_FAILED(nr)) {
return false;
}
domainWhiteList.StripWhitespace();
if (domainWhiteList.IsEmpty() || hostName.IsEmpty()) {
return false;
}
// Get UTF8 to ASCII domain name normalization service
nsresult rv;
nsCOMPtr<nsIIDNService> idnService =
do_GetService("@mozilla.org/network/idn-service;1", &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
uint32_t begin = 0;
uint32_t end = 0;
nsCString domainName;
/*
Test each domain name in the comma separated list
after converting from UTF8 to ASCII. Each domain
must match exactly or have a single leading '*.' wildcard
*/
do {
end = domainWhiteList.FindChar(',', begin);
if (end == (uint32_t)-1) {
// Last or only domain name in the comma separated list
end = domainWhiteList.Length();
}
rv = idnService->ConvertUTF8toACE(
Substring(domainWhiteList, begin, end - begin), domainName);
if (NS_SUCCEEDED(rv)) {
if (HostInDomain(hostName, domainName)) {
return true;
}
} else {
NS_WARNING("Failed to convert UTF-8 host to ASCII");
}
begin = end + 1;
} while (end < domainWhiteList.Length());
return false;
}
bool PeerConnectionMedia::GetPrefObfuscateHostAddresses() const {
ASSERT_ON_THREAD(mMainThread); // will crash on STS thread
@ -337,9 +419,8 @@ bool PeerConnectionMedia::GetPrefObfuscateHostAddresses() const {
"media.peerconnection.ice.obfuscate_host_addresses", false);
obfuscate_host_addresses &=
!MediaManager::Get()->IsActivelyCapturingOrHasAPermission(winId);
obfuscate_host_addresses &= !PeerConnectionImpl::HostnameInPref(
"media.peerconnection.ice.obfuscate_host_addresses.whitelist",
mParent->GetWindow()->GetDocumentURI());
obfuscate_host_addresses &=
!HostInObfuscationWhitelist(mParent->GetWindow()->GetDocumentURI());
obfuscate_host_addresses &= XRE_IsContentProcess();
return obfuscate_host_addresses;

Просмотреть файл

@ -424,12 +424,10 @@ pref("media.videocontrols.picture-in-picture.video-toggle.min-video-secs", 45);
pref("media.navigator.video.use_remb", true);
#ifdef EARLY_BETA_OR_EARLIER
pref("media.navigator.video.use_transport_cc", true);
pref("media.peerconnection.video.use_rtx", true);
#else
pref("media.navigator.video.use_transport_cc", false);
pref("media.peerconnection.video.use_rtx", false);
#endif
pref("media.peerconnection.video.use_rtx.blocklist", "*.google.com");
pref("media.peerconnection.video.use_rtx", false);
pref("media.navigator.video.use_tmmbr", false);
pref("media.navigator.audio.use_fec", true);
pref("media.navigator.video.red_ulpfec_enabled", false);