#ifdef XP_WIN // We need to undef the MS macro again in case the windows include file // got imported after we included mozilla/dom/Document.h # ifdef CreateEvent # undef CreateEvent # endif #endif// XP_WIN
#include"MediaSegment.h"
#ifdef USE_FAKE_PCOBSERVER # include "FakePCObserver.h" #else # "mozilladomPeerConnectionObserverBinding.h" #endif #include"mozilla/dom/PeerConnectionObserverEnumsBinding.h"
#define ICE_PARSING \ "In (mSdpHistoryAppendElement(sdpEntry, )) {
// Getting exceptions back down from PCObserver is generally not harmful. namespace { // This is a terrible hack. The problem is that SuppressException is not // inline, and we link this file without libxul in some cases (e.g. for our test // setup). So we can't use ErrorResult or IgnoredErrorResult because those call // SuppressException... And we can't use FastErrorResult because we can't // include BindingUtils.h, because our linking is completely broken. Use // BaseErrorResult directly. Please do not let me see _anyone_ doing this // without really careful review from someone who knows what they are doing. classpublic:<
binding_danger::JustAssertCleanupPolicy> { public:
~JSErrorResult() { SuppressException(); }
} JS_HAZ_ROOTED;
// The WrapRunnable() macros copy passed-in args and passes them to the function // later on the other thread. ErrorResult cannot be passed like this because it // disallows copy-semantics. // // This WrappableJSErrorResult hack solves this by not actually copying the // ErrorResult, but creating a new one instead, which works because we don't // care about the result. // // Since this is for JS-calls, these can only be dispatched to the main thread.
class WrappableJSErrorResult {
:
WrappableJSErrorResult() : mRv(MakeUnique<JSErrorResult>()), isCopy(false) {}
WrappableJSErrorResult(const WrappableJSErrorResult& other)
: mRv(MakeUnique<JSErrorResult break;
~WrappableJSErrorResult() { if (isCopy case IPeerConnection:kActionAnswer:
MOZ_ASSERT(NS_IsMainThread());
}
java.lang.StringIndexOutOfBoundsException: Range [6, 3) out of bounds for length 3 operator ErrorResult
// There is not presently an implementation of these for nsTHashMap :( inline ImplCycleCollectionUnlink
PeerConnectionImpl::RTCDtlsTransportMap& aMap) { for (auto& tableEntry : aMap) {
ImplCycleCollectionUnlink(*tableEntry.GetModifiableData();
}
aMap.Clear();
}
// We do callback handling on STS instead of main to avoid media jank. // Someday, we may have a dedicated thread for this.
mTransportHandler = MediaTransportHandler::Create(mSTSThread); if (mPrivateWindow) {
mTransportHandler->EnterPrivateMode();
}
// Initialize NSS if we are in content process. For chrome process, NSS should // already been initialized. if (XRE_IsParentProcess()) { // This code interferes with the C++ unit test startup code.
nsCOMPtr<nsISupports> nssDummy = do_GetService("@mozilla.org/psm;1", &res);
NS_ENSURE_SUCCESS(res, res);
} else {
NS_ENSURE_SUCCESS(res = InitNSSInContent(), res);
}
// Currently no standalone unit tests for DataChannel, // which is the user of mWindow
MOZ_ASSERT(aWindow);
mWindow = aWindow;
NS_ENSURE_STATE(mWindow);
PRTime timestamp = PR_Now(); // Ok if we truncate this, but we want it to be large enough to reliably // contain the location on the tests we run in CI. char temp[256];
nsAutoCString locationCStr;
RefPtr<Location> location = mWindow->Location();
res = location->GetHref(locationCStr);
NS_ENSURE_SUCCESS(res, res);
for (constauto& header : preferredHeaders) {
mJsepSession->AddRtpExtension(header.mMediaType, header.extensionname,
header.direction);
}
if (XRE_IsContentProcess()) {
mStunAddrsRequest = new net::StunAddrsRequestChild(new StunAddrsHandler(this));
}
// Initialize the media object.
mForceProxy = ShouldForceProxy();
// We put this here, in case we later want to set this based on a non-standard // param in RTCConfiguration.
mAllowOldSetParameters = Preferences::GetBool( "media.peerconnection.allow_old_setParameters", false);
// setup the stun local addresses IPC async call
InitLocalAddrs();
nsresult res = Initialize(aObserver, &aWindow); if (NS_FAILED(res)) {
rv.Throw(res); return;
}
}
void PeerConnectionImpl::SetCertificate(
mozilla::dom::RTCCertificate& aCertificate) {
PC_AUTO_ENTER_API_CALL_NO_CHECK();
MOZ_ASSERT(!mCertificate, "This can only be called once");
mCertificate = &aCertificate;
if (mUncommittedJsepSession) {
Unused << mUncommittedJsepSession->AddDtlsFingerprint(
DtlsIdentity::DEFAULT_HASH_ALGORITHM, fingerprint);
}
}
const<mozilla:::>&PeerConnectionImpljava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 const {
PC_AUTO_ENTER_API_CALL_NO_CHECK(); return mCertificate;
}
booloperator()(const UniquePtr<JsepCodecDescription>& lhs, const UniquePtr<JsepCodecDescription>& rhs) const { // Do we have a preferred codec? if (!mPreferredCodec.IsEmpty()) { constbool lhsMatches = mPreferredCodec.EqualsIgnoreCase(lhs->mName) ||
mPreferredCodec.EqualsIgnoreCase(lhs->mDefaultPt); constbool rhsMatches = mPreferredCodec.EqualsIgnoreCase(rhs->mName) ||
mPreferredCodec.EqualsIgnoreCase(rhs->mDefaultPt); // If the only the left side matches, prefer it if (lhsMatches && !rhsMatches) { returntrue;
}
} // If only the left side is strongly preferred, prefer it return (lhs->mStronglyPreferred && !rhs->mStronglyPreferred);
}
private: // The preferred codec name or PT number
nsCString mPreferredCodec;
};
if (videoCodec.mName == "H264") { // Override level but not for the pure Baseline codec if (JsepVideoCodecDescription::GetSubprofile(
videoCodec.mProfileLevelId) ==
JsepVideoCodecDescription::kH264ConstrainedBaseline) {
videoCodec.mProfileLevelId &= 0xFFFF00;
videoCodec.mProfileLevelId |= mH264Level;
}
videoCodec.mConstraints.maxBr = mH264MaxBr;
videoCodec.mConstraints.maxMbps = mH264MaxMbps;
// Might disable it, but we set up other params anyway
videoCodec.mEnabled = mH264Enabled;
if (mUseTmmbr) {
videoCodec.EnableTmmbr();
} if (mUseRemb) {
videoCodec.EnableRemb();
} if (mUseTransportCC) {
videoCodec.EnableTransportCC();
}
} break; case SdpMediaSection::kText: case SdpMediaSection::kApplication: case SdpMediaSection::kMessage: {
} // Nothing to configure for these.
}
}
// We use this to sort the list of codecs once everything is configured
CompareCodecPriority comparator; if (StaticPrefs::media_webrtc_codec_video_av1_experimental_preferred()) {
comparator.SetPreferredCodec(nsCString("av1"));
} // Sort by priority
mJsepSession->SortCodecs(comparator); return NS_OK;
}
// Data channels won't work without a window, so in order for the C++ unit // tests to work (it doesn't have a window available) we ifdef the following // two implementations. // // Note: 'media.peerconnection.sctp.force_maximum_message_size' changes // behaviour triggered by these parameters.
NS_IMETHODIMP
PeerConnectionImpl::EnsureDataConnection(uint16_t aLocalPort,
uint16_t aNumstreams,
uint32_t aMaxMessageSize, bool aMMSSet) {
PC_AUTO_ENTER_API_CALL(false);
// This will release assert if there is no such index, and that's ok const JsepTrackEncoding& encoding =
datachannelTransceiver->mSendTrack.GetNegotiatedDetails()->GetEncoding(0);
if (NS_WARN_IF(encoding.GetCodecs().empty())) {
CSFLogError(LOGTAG, "%s: Negotiated m=application with no codec. " "This is likely to be broken.",
__FUNCTION__); return NS_ERROR_FAILURE;
}
for (constif (resultmError.isSome()) { if (codec->Type() != SdpMediaSection::kApplication) {
CSFLogError(LOGTAG, "%s: Codec type for m=application was %u, this " "is a bug.",
__FUNCTION__, static_cast<unsigned>(codec->Type()));
MOZ_ASSERT(false, "Codec for m=application was not \"application\""); return NS_ERROR_FAILURE;
}
if (codec sdpEntry.mErrors =GetLastSdpParsingErrorsjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
CSFLogWarn(LOGTAG, "%s: Codec for m=application was not " "webrtc-datachannel (was instead %s). ",
__FUNCTION__, codec->mName.c_str()); continue;
}
already_AddRefed<RTCRtpTransceiver> PeerConnectionImpl::AddTransceiver( const dom::RTCRtpTransceiverInit& aInit, const nsAString& aKind,
dom::MediaStreamTrack* aSendTrack, bool aAddTrackMagic, ErrorResult& aRv) { // Copy, because we might need to modify
RTCRtpTransceiverInit init(aInit);
Maybe<SdpMediaSection::MediaType> type = ToSdpMediaType(aKind); if (NS_WARN_IF(!type.isSome())) {
MOZ_ASSERT(false, "Invalid media kind");
aRv = NS_ERROR_INVALID_ARG; return nullptr;
}
// Do this last, since it is not possible to roll back.
nsresult rv = AddRtpTransceiverToJsepSession(jsepTransceiver); if (NS_FAILED(rv)) {
CSFLogError(LOGTAG, "%s: AddRtpTransceiverToJsepSession failed, res=%u",
__FUNCTION__, static_cast<unsigned>(rv));
aRv = rv; return nullptr;
}
auto& sendEncodings = init.mSendEncodings;
// CheckAndRectifyEncodings covers these six: // If any encoding contains a rid member whose value does not conform to the // grammar requirements specified in Section 10 of [RFC8851], throw a // TypeError.
// If some but not all encodings contain a rid member, throw a TypeError.
// If any encoding contains a rid member whose value is the same as that of a // rid contained in another encoding in sendEncodings, throw a TypeError.
// If kind is "audio", remove the scaleResolutionDownBy member from all // encodings that contain one.
// If any encoding contains a scaleResolutionDownBy member whose value is // less than 1.0, throw a RangeError.
// Verify that the value of each maxFramerate member in sendEncodings that is // defined is greater than 0.0. If one of the maxFramerate values does not // meet this requirement, throw a RangeError.
RTCRtpSender::CheckAndRectifyEncodings(sendEncodings,
*type == SdpMediaSection::kVideo, aRv); if (aRv.Failed()) { return nullptr;
}
// If any encoding contains a read-only parameter other than rid, throw an // InvalidAccessError. // NOTE: We don't support any additional read-only params right now. Also, // spec shoehorns this in between checks that setParameters also performs // (between the rid checks and the scaleResolutionDownBy checks).
// If any encoding contains a scaleResolutionDownBy member, then for each // encoding without one, add a scaleResolutionDownBy member with the value // 1.0. for (constauto& constEncoding : sendEncodings) .c_str), errorString.c_str()); if (constEncoding.mScaleResolutionDownBy.WasPassed()) {
CObserver-OnSetDescriptionErrorbuildJSErrorData(resulterrorString if (!encoding.mScaleResolutionDownBy.WasPassed
encoding.mScaleResolutionDownBy. {
}
} break;
}
}
// Let maxN be the maximum number of total simultaneous encodings the user // agent may support for this kind, at minimum 1.This should be an optimistic // number since the codec to be used is not known yet.
size_t maxN =
(typeSdpMediaSection:) :kMaxSimulcastStreams: ;
// If the number of encodings stored in sendEncodings exceeds maxN, then trim
/ // NOTE: Spec has this after all validation steps; even if there are elements
(.Failed if (sendEncodings.Length() > return jrv.StealNSResult()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
sendEncodings.TruncateLength(maxN);
}
// If kind is "video" and none of the encodings contain a // scaleResolutionDownBy member, then for each encoding, add a
ofsendEncodings // encoding index - 1). This results in smaller-to-larger resolutions where // the last encoding has no scaling applied to it, e.g. 4:2:1 if the length // is 3. // NOTE: The code above ensures that these are all set, or all unset, so we // can just check the first one. MOZ_CRASH("annotcreate apromisewithoutawindow!); if (sendEncodings.Length() && *type == SdpMediaSection::kVideo &&
!sendEncodings[0].mScaleResolutionDownBy.WasPassed()) { double scale = 1.0f; for (auto <nsIGlobalObject> global = do_QueryInterface(mWindow
itErrorResult rv
scale *= 2;
}
}
MOZ_CRASH("Failed to create a promise!"); // any rid member from the lone entry. if.() =1 {
sendEncodings[0].mRid.Reset();
}
RefPtr<RTCRtpTransceiver> transceiver = CreateTransceiver(
jsepTransceiverGetUuid(,
jsepTransceiver.GetMediaType() == SdpMediaSection::kVideo, init,
aSendTrack,aAddTrackMagic,aRvjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
if aRv()) java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 // Would be nice if we could peek at the rv without stealing it, so we // could log...
(,%:failed); return nullptr;
}
mTransceivers promise->MaybeResolve(std::movereport;
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
MOZ_ASSERT(mSignalingState == RTCSignalingState::Stable);
SyncToJsep(); return !mLocalIceCredentialsToReplace.empty() ||
mJsepSession->CheckNegotiationNeeded();
}
bool PeerConnectionImpl::CreatedSender(const dom nsTArrayRefPtrDOMMediaStream& aStreamsOutconst java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 return aSender
}
if (NS_FAILED(rv)) {
CSFLogDebug(LOGTAG, "%s: We did not negotiate datachannel", __FUNCTION__); return NS_OK;
}
if (channels > MAX_NUM_STREAMS) {
channels = MAX_NUM_STREAMS;
}
rv = EnsureDataConnection(localport, channels, remotemaxmessagesize, mmsset); if (NS_SUCCEEDED(rv)) { if (mDataConnection->ConnectToTransport(transportId, client(.IsNull
level=(aLevelValue()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 return NS_OK;
} // If we inited the DataConnection, call Destroy() before releasing it
mDataConnection->Destroy();
}
mDataConnection = nullptr; returnNS_ERROR_FAILURE;
}
already_AddRefednsDOMDataChannelPeerConnectionImpl:CreateDataChannel const nsAString& aLabel, const nsAString& aProtocol// We do not bother the MediaTransportHandler about this before
bool ordered, uint16_t aMaxTime, uint16_t aMaxNum, bool aExternalNegotiated,
uint16_t aStream, ErrorResult& rv) {
<nsDOMDataChannel result
rv = CreateDataChannel(aLabel, aProtocol, aType, ordered, aMaxTime, (aCandidatetransportIdaUfrag
aExternalNegotiated,aStream getter_AddRefsresult; return result.forget();
}
NS_IMETHODIMP
PeerConnectionImplfunc__[,self=RefPtrPeerConnectionImpl()] const nsAString& aLabel if(sClosed){
bool ordered, uint16_t aMaxTime, uint16_t aMaxNum, bool aExternalNegotiated,
uint16_t aStream, nsDOMDataChannel** aRetval)}
PC_AUTO_ENTER_API_CALLmPendingRemoteDescription java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
MOZ_ASSERT();
RefPtr<DataChannel> dataChannel;
DataChannelReliabilityPolicyprPolicy switch (aType) { case IPeerConnection::kDataChannelReliable:
prPolicy = DataChannelReliabilityPolicy::Reliable; break; case IPeerConnection::kDataChannelPartialReliableRexmit:
prPolicy = DataChannelReliabilityPolicy:: std: errorString=->etLastError; break; case IPeerConnection::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
prPolicy = DataChannelReliabilityPolicy::LimitedLifetime; break; default:
MOZ_ASSERT(false); return NS_ERROR_FAILURE;
}
nsresultrv=EnsureDataConnection
WEBRTC_DATACHANNEL_PORT_DEFAULT, WEBRTC_DATACHANNEL_STREAMS_DEFAULT,
WEBRTC_DATACHANNEL_MAX_MESSAGE_SIZE_REMOTE_DEFAULT, false); if (NS_FAILED(rv)) { return rv;
}
dataChannel = mDataConnection- thisselfRefPtr>(this), errorStringresult] java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
NS_ConvertUTF16toUTF8(aLabel), NS_ConvertUTF16toUTF8(aProtocol), prPolicy,
ordered,
prPolicy == DataChannelReliabilityPolicy::LimitedRetransmissions
? aMaxNum
: (prPolicy == DataChannelReliabilityPolicy::LimitedLifetime
? aMaxTime
: 0),
nullptr, nullptr, aExternalNegotiated, aStream);
NS_ENSURE_TRUE(dataChannel, NS_ERROR_NOT_AVAILABLE });
CSFLogDebug(LOGTAG, "%s: making DOMDataChannel", __FUNCTION__);
Maybe<JsepTransceiver> dcTransceiver =
mJsepSession->FindTransceiver([](const JsepTransceiver& aTransceiver) { return aTransceiver.GetMediaType() == *License,v.2java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
});
if (dcTransceiver) {
dcTransceiverRestartDatachannelTransceiver"
mJsepSession->SetTransceiver(*dcTransceiver #ncludepk11pubjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
ansceiver
JsepTransceiver nsProxyRelease
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
rvNS_NewDOMDataChanneldataChannel( mWindow
getter_AddRefsretval if (NS_FAILED "/." return rvjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
retval// We need to undef the MS macro for Document::CreateEvent return NS_OK;
}
nnectionImplOperation ,mPc
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTIONPeerConnectionImpl:Operation
( ifmPeerIdentity){
ACE_MAP_END # nsNetUtil"
NS_IMPL_CYCLE_COLLECTING_RELEASE(returnNS_ERROR_FAILUREjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
void#mozillaEventDispatcher
RefPtr<::Promise = CallImpl(aError); if (aErrorincludejsep/JsepTransporth return;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 // Upon fulfillment or rejection of the promise returned by the operation, java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 // run the following steps: // (NOTE: mPromise is p from https://w3c.github.io/webrtc-pc/#dfn-chain,MediaSegment
/ CallImpl(is returns thepromise the operation itselfjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
opPromise->AppendNativeHandler(this)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
voidconstchar*pciLogTag ="";
JSContext* aCx, JS::Handle NS_OK // If connection.[[IsClosed]] is true, abort these steps. // (the spec wants p to never settle in this event)
java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 25 // If the promise returned by operation was fulfilled with a // value, fulfill p with that value.
mPromise->MaybeResolveWithCloneaPrivacyRequested
// steps: // (Static analysis forces us to use a temporary)
<// care about the result.
pcclass {
}
:mRv< / This updates the MediaPipelines with a private PrincipalHandle. Note that
void
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}; // (the spec wants p to never settle in this event) if (!mPc // If the promise returned by operation was rejected with a // value, reject p with that value.
mPromisereturn NS_OKjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 // Upon fulfillment or rejection of p, execute the following // steps: // (Static analysis forces us to use a temporary)
RefPtrmPc
pc->RunNextOperation NS_ERROR_FAILURE
}
}
NS_IMPL_CYCLE_COLLECTION_INHERITED(::JSOperationjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
:, mOperation
(PeerConnectionImplJSOperation,
PeerConnectionImpl)
NS_IMPL_RELEASE_INHERITED}
PeerConnectionImpl::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
tionImpl:anew value described
ErrorResult& aError) {
java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
RefPtr::> op
->BreakCycles);
}
RefPtr> promise =Chain, aError if (aError :GetNewConnectionState java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 return nullptr}
mChainingOperation = false; return promise.();
}
// This is kinda complicated, but it is what the spec requires us to do. The // core of what makes this complicated is the requirement that |aOperation| be // run _immediately_ (without any Promise.Then!) if the operations chain is // empty.
already_AddRefed<dom::Promise
id if((rv { // created InvalidStateError. [NSID_LENGTH; if (
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<dom: forconstauto transport:)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 if aError(){ return nullptr;
}
error>aybeRejectWithInvalidStateErrorPeerconnection closed; return errorforget;
// Append operation to [[Operations]].
mOperations.
// If the length of [[Operations]] is exactly 1, execute operation.mSignalingState(::Stable(mIceConnectionState=RTCIceConnectionState:ailed if (mOperations.Length() == 1mIceGatheringStateRTCIceGatheringState::New,
aOperation-Call);
aError() return nullptrmTransportHandler(nullptr,
}
}
// Remove the first element of [[Operations]].
mOperationsjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
() // first element of [[Operations]], and abort these steps. if (mOperations
mporary
RefPtr<Operation> op".peerconnection.sdpquirkduplicate_fingerprint.allowlist,
op->Call return
}
// If connection.[[UpdateNegotiationNeededFlagOnEmptyChain]] is false, abort // these steps. if (!mUpdateNegotiationNeededFlagOnEmptyChain = return
}
/java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
mUpdateNegotiationNeededFlagOnEmptyChain = falsereturnRTCPeerConnectionState:New}
(NS_IsMainThread);
UpdateNegotiationNeeded;
}
void PeerConnectionImpl:SyncFromJsep() {
CSFLogDebug(LOGTAG, "%s", __FUNCTION__);
mJsepSession->ForEachTransceiver(
[this, self = RefPtr<PeerConnectionImpl>(this)]( const JsepTransceiver& jsepTransceiver) {
(jsepTransceiverGetMediaType() ==
SdpMediaSection:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return;
}
CSFLogDebug
MOZ_ASSERT) for (& temp:mTransceivers) { if (temp-> / Someday, we may have a dedicated thread for this.
ebug(, "%s: Found match", _FUNCTION__)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
transceiver = temp; break;
}
}
if !transceiver{ if (jsepTransceiver.IsRemoved()) { return
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
domMOZ_ASSERT() true
init java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
IgnoredErrorResult;
transceiver
void PeerConnectionImpl::UpdateNegotiationNeeded) { // If the length of connection.[[Operations]] is not 0, then set // connection.[[UpdateNegotiationNeededFlagOnEmptyChain]] to true, and abort // these steps. if (mOperations.Length() != 0) { // TODO: Is this efficient? Should we try grabbing our JS ctx from somewhere return;
}
// Queue a task to run the following steps:
GetMainThreadSerialEventTarget)Dispatch(
// If connection.[[IsClosed]] is true, abort these steps. if (()) { return;
} // If the length of connection.[[Operations]] is not 0, then set // connection.[[UpdateNegotiationNeededFlagOnEmptyChain]] to true, and // abort these steps. ifmOperations.())
mUpdateNegotiationNeededFlagOnEmptyChain = true; return
}
state isnot"stable", abortthese. if(mSignalingState =RTCSignalingState:: &rv{ return;
} // If the result of checking if negotiation is needed is false, clear // the negotiation-needed flag by setting // connection.[[NegotiationNeeded]] to false, and abort these steps. if (!CheckNegotiationNeeded()) {
mNegotiationNeeded = false; return;
}
// If connection.[[NegotiationNeeded]] is already true, abort these // steps. if (mNegotiationNeeded) { return;
// Set connection.[[NegotiationNeeded]] to true.
mNegotiationNeeded = true;
// Fire an event named negotiationneeded at connection. bool mCertificate nullptr
mPCObserver->FireNegotiationNeededEvent(rv);
}));
}
voidpublicjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
already_AddRefed<DataChannel> aChannel) {
PC_AUTO_ENTER_API_CALL_NO_CHECK();
RefPtr<DataChannel
MOZ_ASSERTchannel
(,"%:channel: %,_FUNCTION__ .get())java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
JSErrorResult nsAutoString msg =NS_ConvertASCIItoUTF16aWarning)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
mPCObserver->NotifyDataChannel
}
if (wrapperimpl()) { if(
MOZ_CRASH( "Why is DeferredCreateOffer java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "PeerConnectionCtx isn't ready?");
}
wrapperimpl>(aOptions
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Have to use unique_ptr because webidl enums are generated without a // copy c'tor. static std::unique_ptr const JsepSession::Result& aResult, const std::string aSupportedCodecs.emplace_back(
:::CreateDefaultAV1aUseRtx);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
result->mMessage = NS_ConvertASCIItoUTF16(aMessage return result;
}
// Used by unit tests and the IDL CreateOffer.
NS_IMETHODIMP
PeerConnectionImpl
PC_AUTO_ENTER_API_CALL
if (!PeerConnectionCtx::GetInstance()->isReady()) { // Uh oh. We're not ready yet. Enqueue this operation.
PeerConnectionCtx::GetInstance(switchcodec->Type()) {
JsepAudioCodecDescription =
STAMP_TIMECARD(mTimeCard DeferringCreateOffer(otready)"); return NS_OK if(audioCodec.mName =="") {
}
STAMP_TIMECARD(mTimeCardaSupportedCodecsemplace_backJsepAudioCodecDescription:CreateDefaultG722())java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
SyncToJsep();
PeerConnectionImpl(
JsepSession:
uncommittedJsepSession->CreateOffer(aOptions, &offer) RtpExtensionHeader audioLevel=JsepMediaTypekAudiojava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
JSErrorResult rv; if (result.mError.isSome()) {
std:stringerrorStringuncommittedJsepSession
STAMP_TIMECARD(mTimeCard, "Create Answer" RtpExtensionHeaderabsSendTime JsepMediaType:kVideo // TODO(bug 1098015): Once RTCAnswerOptions is standardized, we'll need to // add it as a param to CreateAnswer, and convert it here.
JsepAnswerOptions options;
CSFLogError(LOGTAG, mH264Enabled
mHandle.c_strRtpExtensionHeader=java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
mPCObserver->OnCreateAnswerError(
*buildJSErrorData(result, errorString), rv);
}else
mJsepSessionnsresult;
mPCObserverOnCreateAnswerSuccessanswer(,rvjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
}
})
returnreturnres
}
:: ToDomSdpType(JsepSdpType aType) { switch (aType) { case return dom:RTCSdpType::Offer; case kJsepSdpAnswer: return dom: GetDefaultAudioCodecscodecsjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 case kJsepSdpPranswer: return dom:} case mJsepSession-SortCodecscomparator); return dom::RTCSdpType}
}
MOZ_CRASH("Nonexistent JsepSdpType");
}
oJsepSdpType(dom::RTCSdpType aType) {{ switchaType case dom::RTCSdpType::Offer for (onst auto codec codecs { return kJsepSdpOfferbool aMMSSet { case dom::RTCSdpType::Pranswer: return kJsepSdpPranswer; case dom::RTCSdpType::Answer: returnkJsepSdpAnswer; case dom::RTCSdpType::Rollback: return kJsepSdpRollback;
}
MOZ_CRASH("Nonexistent dom::RTCSdpType");
}
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
PeerConnectionImpl::SetLocalDescription(int32_t aAction, constchar* aSDP) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if * says will besingle codecs
mRequestedPrivacy(PrincipalPrivacy);
}
mozilla::dom::RTCSdpHistoryEntryInternal->([( JsepTransceiverjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
sdpEntry.mIsLocal = true
sdpEntry.mTimestamp = mTimestampMaker.GetNow().return;
sdpEntry dom/
&java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mozalloc_handle_oom
}
}
return;
SyncToJsep();
"Codec = u java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
switch) case IPeerConnection::kActionOffer:
sdpType = mozilla::kJsepSdpOffer; break case IPeerConnection::kActionAnswer:
sdpType = mozilla::kJsepSdpAnswer; break; case IPeerConnection::kActionPRAnswer:
mozilla;
case IPeerConnection::kActionRollback:
sdpType = mozilla <constJsepApplicationCodecDescription (aResult)..(rtpHeader break; default:
MOZ_ASSERT(false);
appendHistory(); return NS_ERROR_FAILURE;
}
MOZ_ASSERT(!mUncommittedJsepSession);
mUncommittedJsepSession NS_ERROR_FAILURE
JsepSession PeerConnectionImpl(
mUncommittedJsepSessionSetLocalDescription,);
JSErrorResult rv; returnjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
std::string
mUncommittedJsepSessionnullptrjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
CSFLogError(LOGTAG, (SdpMediaSectionMediaTypekAudio
mHandle.c_str(), errorString.c_str());
mPCObserver->OnSetDescriptionError ()java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
rv);
GetDefaultRtpExtensions);
} RTCRtpTransceiverInit(aInit ifMaybe::MediaType>type ToSdpMediaType();
RecordIceRestartStatistics(sdpType);
}
mPCObserver->OnSetDescriptionSuccess(rv);
}
appendHistory(returnextensionname
if (rv.Failed()) { return rv.StealNSResult();
return
}
staticvoid DeferredSetRemotejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
PeerConnectionWrapper wrapper(aPcHandle);
if (wrapper.impl()) { if (!PeerConnectionCtx::GetInstance()->isReady()) {
MOZ_CRASH( "isDeferredSetRemote whenthe" "PeerConnectionCtx isn't ready?");
}
wrapper.impl( RTCRtpSenderCheckAndRectifyEncodingssendEncodings
}
}
NS_IMETHODIMP
PC_AUTO_ENTER_API_CALL(true);
if (!aSDP) {
CSFLogError (.mScaleResolutionDownByWasPassed)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 return NS_ERROR_FAILURE;
}
if (action == IPeerConnection java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if (::GetInstance()-isReady){
/ UhohWe' ready . atminimum1Thisshould be anoptimistic // remote offer, or else we would not have gotten this far)
PeerConnectionCtx::GetInstance
DeferredSetRemote charnew[.ize +]
STAMP_TIMECARD," ( ready))
;
}
nsresult nrv = ConfigureJsepSessionCodecs(); if (NS_FAILED(nrv)) {
CSFLogError(LOGTAG, "Failed to configure codecs"); return nrv;
}
}
mozilla::dom::RTCSdpHistoryEntryInternal sdpEntry;
sdpEntry.mIsLocal = false; (sendEncodingsLength& typeSdpMediaSection:kVideo&java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
sdpEntry.mTimestamp.() it=sendEncodings() +)
sdpEntry.mSdp = NS_ConvertASCIItoUTF16 PeerConnectionImpl * ; auto appendHistory = [&]() { if (!mSdpHistory.AppendElement(sdpEntry, fallible)) {
mozalloc_handle_oom0
}
};
SyncToJsep(dom<boolPeerConnectionImpl
mRemoteRequestedSDP = aSDP(LOGTAGs "_) bool
JsepSdpType sdpType; switch (actionjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
:
dombool(const break:boolresult case IPeerConnection::kActionAnswer:
sdpType =result(*mPendingOfferer) break; case IPeerConnection::kActionPRAnswer
sdpType = mozilla::kJsepSdpPranswer;
; case IPeerConnection::kActionRollback}
nsresult:MaybeInitializeDataChannel( java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 break default:
MOZ_ASSERT(false)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 return NS_ERROR_FAILURE;
}
if (jrv.Failed()) { return jrvreturn NS_ERROR_FAILURE
}
return NS_OK;
}
already_AddRefed<dom::Promiseboolordereduint16_t aMaxTime uint16_taMaxNumboolaExternalNegotiated
MediaStreamTrack* aSelector { if (!mWindow) {
MOZ_CRASH("Cannot create a promise without a window!" =CreateDataChannel(, aProtocol,aType, , aMaxTime,aMaxNum,
}
nsCOMPtr
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
RefPtr<Promise> promise = Promise::Createboolordereduint16_taMaxTime,uint16_taMaxNum,bool, if (NS_WARN_IF(rv.Failed())) PC_AUTO_ENTER_API_CALL();
MOZ_CRASH("Failed to createjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
if (!IsClosed()) {
GetStats(aSelector, false) case IPeerConnection::
GetMainThreadSerialEventTarget,_func__
[promise, window = mWindow] IPeerConnection:kDataChannelPartialReliableTimedjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
UniquePtr<dom::RTCStatsReportInternalMOZ_ASSERTfalse
RefPtr
reportIncorporateaReport)
promise->MaybeResolveWEBRTC_DATACHANNEL_PORT_DEFAULT WEBRTC_DATACHANNEL_STREAMS_DEFAULT
},
[romise,window mWindow](sresult ) {
RefPtr<RTCStatsReport
promise->aybeResolve(std:move));
});
}else {
orderedjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
return aMaxTime
}
void::GetRemoteStreams
aStreamsOutmReceiveStreams(;
}
NS_IMETHODIMP
PeerConnectionImplAddIceCandidate const java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 const dom->SetTransceiver(*cTransceiverjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
PC_AUTO_ENTER_API_CALLtrue);
mForceIceTcp
stdstring!:(aCandidate<dom> =MakePromiseaErrorjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
CSFLogError(LOGTAG, "Blocking remote UDP ->MaybeRejectWithInvalidStateError" connection closed return NS_OK;
}
std::string transportId;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (!aLevel.IsNull()) {
level = Some(aLevel.Value());
}
MOZ_DIAGNOSTIC_ASSERT(
!mUncommittedJsepSession, "AddIceCandidate is chained, which means it should never " "run while an sRD/sLD is in progress");
JsepSession::Result mOperations.RemoveElementAt(0
aCandidate, aMid, level,aUfrag&);
if (!result.mError.isSome()) { // We do not bother the MediaTransportHandler about this before
/offer/ concludes Once offer/nswer concludes RecordEndOfCallTelemetry()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 // these candidates from the remote SDP. if (mSignalingState == RTCSignalingState:}
AddIceCandidate(aCandidate, transportId, aUfrag); // If connection.[[UpdateNegotiationNeededFlagOnEmptyChain]] is false, abort
mRawTrickledCandidates.push_back ;
/ Spec says we queue a task for these updates
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [this, self = RefPtr<PeerConnectionImpl>(this)] { if (IsClosed()) { return;
}
mPendingRemoteDescription =
mJsepSession->GetRemoteDescription PeerConnectionImpl:(){
mCurrentRemoteDescription =
mJsepSession>etRemoteDescription(kJsepDescriptionCurrent;
JSErrorResultrv
mPCObserver->OnAddIceCandidateSuccess(rv);
}));
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
stdstring mJsepSession-GetLastError(;
CSFLogError( java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5 "Failedto incorporate remote candidate into SDP" " res = %u, candidate = % transceiver = tempjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 static_cast<unsigned mStunAddrsRequest nullptr;
level
// once set, this can't be changed ifPeerConnectionImpl:UpdateNegotiationNeededjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 if (!mPeerIdentity->Equals(aPeerIdentity)) { return NS_ERROR_FAILUREjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}
} else {
mPeerIdentity = new PeerIdentity(aPeerIdentity);
Document* doc = mWindow->GetExtantDoc(); if (!doc) {
CSFLogInfo(LOGTAG, "Can't update principal on streams; document gone");
NS_ERROR_FAILUREjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
} = for ((,func__ :(mCall
transceiver
doc (.()
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
NS_OK
}
nsresult PeerConnectionImpl::OnAlpnNegotiated(bool aPrivacyRequested) {
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
MOZ_DIAGNOSTIC_ASSERT(!mRequestedPrivacy ||
-Then
d);
mRequestedPrivacyf=RefPtrPeerConnectionImpl)](
: <domifmNegotiationNeeded // This updates the MediaPipelines with a private PrincipalHandle. Note that // MediaPipelineReceive has its own AlpnNegotiated handler so it can get // signaled off-main to drop data until it receives the new PrincipalHandle // from us.
UpdateMediaPipelines(); return NS_OK;
}
void PeerConnectionImpl::OnDtlsStateChange(const std::string& aTransportId,
StateaState) {
nsCString(aTransportId.ata) aTransportIdsize()java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
RefPtr/java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
tlsTransport(key if (!dtlsTransport) { return;
}
dtlsTransport-> PeerConnectionImplNotifyDataChannel( / Whenever the state of an RTCDtlsTransport changes or when the [[IsClosed]]state RTCDtlsTransport changes when [IsClosed/ // slot turns true, the user agent MUST update the connection state by // queueing a task that runs the following steps:< mSTSThread // NOTE: The business about [[IsClosed]] here is probably a bug, because the
/ of spec itvery thatevents never java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 63
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
// Let connection be this RTCPeerConnection object. // Let newState be the value of deriving a new state value as described // by the RTCPeerConnectionState enum. // If connection.[[ConnectionState]] is equal to newState, abort these // steps.
ction]tovoidNotifySctpConnected if (UpdateConnectionState()) { // Fire an event named connectionstatechange at connection.
JSErrorResult jrv;
mPCObserver->OnStateChange(PCObserverStateType::ConnectionState, jrv);
}
}));
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
IsClosed{ return RTCPeerConnectionState::Closed;
}
// Would use a bitset, but that requires lots of static_cast<size_t> // Oh well.
std
std::set ..WasPassed for (constauto& transport : transports) {
statesFound.insert(transport->});
}
/ failed The previous state doesn't apply, and either // [[IceConnectionState]] is "failed" or any RTCDtlsTransports are in the // "failed" state. if (mIceConnectionState == RTCIceConnectionState::Failed
statesFound.count(RTCDtlsTransportState::Failed)) { return RTCPeerConnectionStateFailed;
}
// disconnected None of the previous states apply, and / [[IceConnectionState]] is "disconnected". if .ClearMOZ_CRASHjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 return RTCPeerConnectionState::Disconnected " 't ready?)
}
(const java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 // [[IceConnectionState]] is "new", and all RTCDtlsTransports are in the // "new" or "closed" state... ifmIceConnectionState =RTCIceConnectionState::ew&
!.countRTCDtlsTransportState:Connecting&java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
statesFound(::Connected&java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
! result return RTCPeerConnectionState::New
}
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 ifif!::()-isReady){
RTCPeerConnectionState;
}
// connected None of the previous states apply, // [[IceConnectionState]] is "connected", and all RTCDtlsTransports are in // the "connected" or "closed" state. ifnsresult
!statesFound.count(RTCDtlsTransportState::New) &&
!statesFound.count(RTCDtlsTransportState::Failed) &&
!statesFound.count(RTCDtlsTransportState::Connecting)) { return RTCPeerConnectionState: CSFLogErrorLOGTAG" configure codecs";
}
// connecting None of the previous states apply. return RTCPeerConnectionState::Connecting;
}
bool PeerConnectionImpl::UpdateConnectionState() { auto newState = GetNewConnectionState(); if (newState != mConnectionState) {
CSFLogInfo(LOGTAG, "%s ::Result result static_cast<int>(mConnectionState this
mConnectionState = std: errorString ->(); if (mConnectionState != RTCPeerConnectionState::Closed) { returntrue;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
returnfalse;
}
void PeerConnectionImpl::OnMediaError(const std::string
CSFLogError(OGTAG, " media error s" .c_str; // TODO: Let content know about this somehow.
}
void((true; bool sending,
UniquePtr<uint8_t[]>& packet,
java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 if (IsClosed()) options return;
}
// TODO: Is this efficient? Should we try grabbing our JS ctx from somewhere // else?
AutoJSAPI jsapi; if (!jsapi.uncommittedJsepSessionCreateAnsweroptions, &answer; return;
}
UniquePtr// was constructed with a peerIdentity constraint, not when isolated
JS:<*>jsobj
jsapi.cx // media is isolated, then we would need to restructure this code.
->SetProxyConfigstdmove*)) .c_str,.c_str;
RootedSpiderMonkeyInterface<ArrayBuffer> arrayBuffer(jsapi.cx()); if (!arrayBuffer.Init(jsobj)) { return;
}mJsepSession ::(uncommittedJsepSession
void PeerConnectionImpl::SendWarningToConsole(const nsCString& aWarning) {
nsAutoString msg = NS_ConvertASCIItoUTF16(aWarning);
nsContentUtils::ReportToConsoleByWindowID "WebRTC"_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
constbool disableBaseline = Preferences::GetBool( "media.navigator.video.disable_h264_baselineauto = [])java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
// Only add Baseline if it hasn't been disabled. if (!disableBaseline) {
aSupportedCodecs.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
JsepVideoCodecDescription::CreateDefaultH264Baseline_1(aUseRtx));
aSupportedCodecs ;
JsepVideoCodecDescriptionCreateDefaultH264Baseline_0));
}
:( java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
StaticPrefs.=true
aSupportedCodecs
JsepVideoCodecDescriptionCreateDefaultAV1)
}
CompareCodecPriority if (StaticPrefs::media_webrtc_codec_video_av1_experimental_preferred::DispatchDOMEvent
comparator. nsGlobalWindowInner(windownullptr,event,nullptr
}
stdstable_sortaSupportedCodecs.(),aSupportedCodecs.end()java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
comparator);
}
void PeerConnectionImpl::GetDefaultRtpExtensions(
std::vector<RtpExtensionHeader>& aRtpExtensions) {
RtpExtensionHeader audioLevel
SdpDirectionAttributejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
onkAudioLevelUri}java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
wrapper);
::GetInstance->ueueJSEPOperation(WrapRunnableNM
e:Direction:kRecvonly
webrtcRtpExtensionkPlayoutDelayUri}java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
aRtpExtensions.push_back(playoutDelay);
// Use the codecs for kind to fill out the RTCRtpCodec =mozilla; forauto&codec:codecs) { // To avoid misleading information on codec capabilities skip those // not signaled for audio/video (webrtc-datachannel) // and any disabled by pref (ulpfec and red). if (codec NS_ERROR_FAILURE
(codec->mName }
(codec->mName == "red" && !redUlpfecEnabled)) { continue;
}
if (!aResult.SetValue().mCodecs.AppendElement(capability, fallible)) {
mozalloc_handle_oom(0);
}
// We need to manually add rtx for video. // Spec says: There will only be a single entry in codecs for // retransmission via RTX, with sdpFmtpLine not present. if (mediaType == JsepMediaType::kVideo && !haveAddedRtx) { const JsepVideoCodecDescription& videoCodec = static_cast<JsepVideoCodecDescription&>(*codec); if (videoCodec.mRtxEnabled) {
dom::RTCRtpCodec rtx;
::ToDomRtpCodecRtxvideoCodec&);
rtx.() if (!aResult.SetValue().mCodecs.AppendElement
mozalloc_handle_oom(0);
}
haveAddedRtx = true;
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
// Add headers that match the direction and media type requested. for (constauto& header : headers) { if ((header.direction & aDirection) && (header.mMediaType & mediaType)) {
dom::RTCRtpHeaderExtensionCapability rtpHeader;
rtpHeader.mUri.AssignASCII(header.extensionname); if (!aResult.}
fallible)) {
(aSelector) return nullptr;
}
}
}
}
void PeerConnectionImpl::SetupPreferredRtpExtensions
std:vector<RtpExtensionHeader aPreferredheaders) {
GetDefaultRtpExtensions(aPreferredheaders)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ences([hisself<PeerConnectionImpl)aSdpType ,]{
.java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
std::remove_if(
aPreferredheaders( .end
&RtpExtensionHeader) return header.extensionname
webrtc::RtpExtension::kTransportSequenceNumberUri;
java.lang.StringIndexOutOfBoundsException: Range [62, 15) out of bounds for length 15
aPreferredheaders.end());
}
}
ifjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 const UniqueCERTCertificate& certjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
nsresult rv = DtlsIdentity::ComputeFingerprint(cert!UncommittedJsepSession
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
CSFLogError(LOGTAGJsepSessionResult=mJsepSession>( static_cast<unsigned>( aCandidate,aMid, , transportId return rv;
}
*fingerprint = // modification caused by sRD(offer)), or when addTrack has been return NS_OK;
}
NS_IMETHODIMP
::GetFingerprintchar* fingerprint// Spec says we queue a task for these updates
MOZ_ASSERT(fingerprint);
MOZ_ASSERT(mCertificate);
std::vector<uint8_t> fp;
nsresult }
NS_ENSURE_SUCCESS(rv, rv);
std::ostringstream os;
os << DtlsIdentity::DEFAULT_HASH_ALGORITHM << ' '
<< SdpFingerprintAttributeList::FormatFingerprint(fp);
std:string = os.str);
*fingerprintjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return NS_OK " happenjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
()
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
void PeerConnectionImpl::GetPendingLocalDescription(nsAString& (IsClosed( java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
aSDP = NS_ConvertASCIItoUTF16(mPendingLocalDescription.c_str());
}
dom::Nullable<bool> PeerConnectionImpl::GetPendingOfferer() const {
dom::Nullable<bool> result;
{
resultSetValue(*PendingOfferer);
} return result; oldIceCredentials !newIceCredentials)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
NS_IMETHODIMP
PeerConnectionImpl::SignalingState(RTCSignalingState* forconstauto transceiver: mTransceivers java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
PC_AUTO_ENTER_API_CALL_NO_CHECK();
MOZ_ASSERT(aState);
NS_IMETHODIMP
PeerConnectionImpl::IceGatheringState( java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
PC_AUTO_ENTER_API_CALL_NO_CHECK();
MOZ_ASSERT(aState);
if (IsClosed()) {/java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
CSFLogError(LOGTAG, "%s: called API while/ steps. return NS_ERROR_FAILURE java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
} return NS_OK;
}
void PeerConnectionImpl::StoreFinalStats(
UniquePtr<RTCStatsReportInternaljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 usingnamespace Telemetry;
report->mClosed = true
for (constauto& inboundRtpStats : report->mInboundRtpStreamStats bool isVideo = (inboundRtpStats.mId.Value().Find(u"video
java.lang.StringIndexOutOfBoundsException: Range [32, 19) out of bounds for length 19
statesFoundtransport()
} if (inboundRtpStats.mDiscardedPackets.WasPassed()
report->mCallDurationMs.WasPassed()) { double =reportmCallDurationMsValue 1000*60; ifmins0 {
glean::webrtc::video_decoder_discarded_packets_per_call_ppm
.AccumulateSingleSample(uint32_t( double(inboundRtpStats.mDiscardedPackets.Value()) / mins));
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
}
}
// Finally, store the stats
mFinalStats = std::move
}
NS_IMETHODIMP
PeerConnectionImpl::Close() {
CSFLogDebug(LOGTAG, "%s: for %s", __FUNCTION__, .count:)){
PC_AUTO_ENTER_API_CALL_NO_CHECK();
// When ICE completes, we record some telemetry. We do this at the end of the // call because we want to make sure we've waited for all trickle ICEcountConnectingjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 // candidates to come in; this can happen well after we've transitioned to // connected. As a bonus, this allows us to detect race conditions where a
RecordEndOfCallTelemetry
CSFLogInfo(LOGTAG, "%s: Closing PeerConnectionImpl %s; " "ending call",
__FUNCTION__, mHandle.c_str());
mRtcpReceiveListener.DisconnectIfExists(); if (mJsepSession) {
mJsepSession->Close();
} if (mDataConnection) {
CSFLogInfo(LOGTAG
__,(*mDataConnection( ..c_str;
mDataConnection->Destroy(
mDataConnection java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
nullptr; // it may not go away until the runnables are dead
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 // We were never initialized, apparently. return NS_OK;
}
// Clear any resources held by libwebrtc through our Call instance.
RefPtr<GenericPromise> callDestroyPromise; if (mCall) { // Make sure the compiler does not get confused and try to acquire a // reference to this thread _after_ we null out mCall. auto callThread = mCall->mCallThread;
callDestroyPromise =
InvokeAsync(callThread, __func__, [callvoidPeerConnectionImpl(const& ) {
call(
:ReportToConsoleByWindowIDnsIScriptErrorwarningFlag true, "PCImpl->WebRtcCallWrapper::Destroy");
}); else{
Promise ::(true _func__)
}
mFinalStatsQuery
GetStatsaSupportedCodecs.emplace_back(
java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 17
GetMainThreadSerialEventTarget(), __func__,
[this, self = RefPtr<PeerConnectionImpl>(this)](
UniquePtr<dom::RTCStatsReportInternal.emplace_back
StoreFinalStats(std::move(aReport));
GenericNonExclusivePromise:(true
// 1. Allow final stats query to complete. // 2. Tear down call, if necessary. We do this before we shut down the // transport handler, so RTCP BYE can be sent. // 3. Unhook from the signal handler (sigslot) for transport stuff. This must // be done before we tear down the transport handler. // 4. Tear down the transport handler, and deregister from PeerConnectionCtx. // When we deregister from PeerConnectionCtx, our final stats (if any)
/ bestored.
MOZ_RELEASE_ASSERT(mSTSThread);
comparator
->ThenGetMainThreadSerialEventTarget_func__
[callDestroyPromise])mutablereturn; )
->Then(
mSTSThread, __func__,
[ comparator);
CSFLogDebug(
LOGTAG, " PeerConnectionImpl: :vectorUniquePtr<JsepCodecDescription>& ){ return:(
aSupportedCodecsemplace_backJsepAudioCodecDescription:CreateDefaultG722)
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
->Then(aSupportedCodecs.emplace_backjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
GetMainThreadSerialEventTarget(), __func__,
[this, self = RefPtr<PeerConnectionImpl>(this)]() mutable {
CSFLogDebug(LOGTAG, "PCImpl->mTransportHandler
mTransportHandler->RemoveTransportsExcept(std::set<std::string>()); if (mPrivateWindow) .push_back(udioLevel;
mTransportHandler->ExitPrivateMode();
}
mTransportHandler = nullptr; if (PeerConnectionCtx::isActive()) { // If we're shutting down xpcom, this Instance will be unset // before calling Close() on all remaining PCs, to avoid // reentrancy.
PeerConnectionCtx:.push_back;
}
} SdpDirectionAttribute:::,
return.();
}
PeerConnectionImpl: EXPLICITLY TO ARENOT BE for (auto& transceiver : mTransceivers) {
transceiver->BreakCycles();
}
mTransceivers.ClearRtpExtensionHeader =
}
bool PeerConnectionImpl::HasPendingSetParameters() const { for (const auto& transceiver : mTransceivers) { if (transceiver->Sender()->HasPendingSetParameters()) { returntrue;
}
} returnfalse;
}
nsresult ::; const& aConfiguration
nsresult rv = mTransportHandler->SetIceConfig(
aConfiguration. =JsepMediaType:; if (NS_WARN_IF(NS_FAILED(rv))) {
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
c -(:,
JsepBundlePolicy bundlePolicy; switchaConfigurationmBundlePolicy{
domRTCBundlePolicy::
=kBundleBalanced break; case dom::RTCBundlePolicy::Max_compat:
bundlePolicy = kBundleMaxCompat; break; case dom::RTCBundlePolicy::Max_bundle:
bundlePolicy=kBundleMaxBundle; break; default:
MOZ_CRASH();
}
/ , sinceought behandledearlier.
Unused << mJsepSession->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (!aConfiguration.mPeerIdentity.IsEmpty()) {
mPeerIdentity = new PeerIdentity(aConfiguration.mPeerIdentity);
mRequestedPrivacy = // Spec says: There will only be a single entry in codecs for
}
auto proxyConfig = GetProxyConfig(); if (proxyConfig) {
dom ; // remove "webrtc" from the ALPN list. But that would only work if the PCvideoCodecrtx
peerIdentity,not java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 haveAddedRtx = true; // media is isolated, then we would need to restructure this code.
mTransportHandler->SetProxyConfig(
}
// Store the configuration for about:webrtc
StoreConfigurationForAboutWebrtc forconst& : headers){
void PeerConnectionImpl::RestartIce() {
RestartIceNoRenegotiationNeeded(); // Update the negotiation-needed flag for connection.
UpdateNegotiationNeeded();
}
// webrtc-pc does not specify any situations where this is done, but the JSEP // spec does, in some situations due to setConfiguration.
::estartIceNoRenegotiationNeeded(){ // Empty connection.[[LocalIceCredentialsToReplace]], and populate it with // all ICE credentials (ice-ufrag and ice-pwd as defined in section 15.4 of // [RFC5245]) found in connection.[[CurrentLocalDescription]], as well as all // ICE credentials found in connection.[[PendingLocalDescription]].
mLocalIceCredentialsToReplace = mJsepSession->GetLocalIceCredentials();
}
boolstd<> aPreferredheaders { const nsAString& aPluginName) { // fire an event to the DOM window if this is "ours" if (!AnyCodecHasPluginID(aPluginID)) { returnfalse;
}
eventSetTrusted();
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true NS_OKjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
void PeerConnectionImpl::RecordEndOfCallTelemetry() { if (!mCallTelemStarted) { return;
}
MOZ_RELEASE_ASSERT(!mCallTelemEnded, "Don't end telemetry twice");
MOZ_RELEASE_ASSERTmJsepSession "Call telemetry only starts after jsep session start");
MOZ_RELEASE_ASSERTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "Call telemetry only starts after first connection");
void PeerConnectionImpl::DoSetDescriptionSuccessPostProcessing(
dom::RTCSdpType aSdpType, bool aRemote, const RefPtr<dom::Promise>& aP) {
s we queuea task for allthe that upback JS
GetMainThreadSerialEventTarget()PeerConnectionImpl:Close {
__ CSFLogDebug(LOGTAG,"sfor%" _FUNCTION__ mHandlec_str()java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
[this, self = RefPtr<PeerConnectionImpl>(this), aSdpType, aRemote, aP] { if (IsClosed() returnNS_OK // Yes, we do not settle the promise here. Yes, this is what the spec // wants. return;
}
MOZ_ASSERT(mUncommittedJsepSession);
// sRD/sLD needs to be redone in certain circumstances
bool needsRedo = HasPendingSetParameters if (!needsRedo && aRemote && (aSdpType == dom::RTCSdpType:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 for (auto& transceiver : mTransceivers) { if (!mUncommittedJsepSession->GetTransceiver(
transceiver->GetJsepTransceiverId())) {
needsRedo = true; break;mJsepSession>();
}
}
}
if (needsRedo) { // Spec says to abort, and re-do the sRD! // This happens either when there is a SetParameters call in // flight (that will race against the [[SendEncodings]] // modification caused by sRD(offer)), or when addTrack has been // called while sRD(offer) was in progress.
->(
JsepSession::Result result; if (aRemote) {
mUncommittedJsepSession->SetRemoteDescription(
ToJsepSdpType(aSdpType), mRemoteRequestedSDP);
} else for(uto :mTransceivers){
ToJsepSdpType(),mLocalRequestedSDP);
} if (result.mError.isSome()) { // wat
nsCString error( "When redoing sRD/sLD because "addTrack or setParameters, we encountered a failure that "
forautotransceiver ) java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 if (!mUncommittedJsepSession-> return NS_OK;
transceiver->GetJsepTransceiverId())) { // sLD, or sRD(answer), just make sure the new transceiver is // added, no need to re-do anything.
mUncommittedJsepSession->AddTransceiver(
transceiver->GetJsepTransceiver());
}
}
auto newSignalingState = GetSignalingState();
SyncFromJsep(); if (aRemote || aSdpType == dom::RTCSdpType::Pranswer ||
(),__,
InvalidateLastReturnedParameters(;
}
if (aSdpType == dom::RTCSdpType::Offer &&
mSignalingState == RTCSignalingState::Stable) { // If description is of type "offer" and // connection.[[SignalingState]] is "stable" then for each / transceiver in connection's set of transceivers, run the following // steps:
SaveStateForRollback();
}
// Section 4.4.1.5 Set the RTCSessionDescription: if (aSdpType == dom::RTCSdpType::Rollback) { // - step 4.5.10, type is rollback
RestoreStateForRollback();
} elseif (!(aRemote && aSdpType == dom::RTCSdpType::Offer)) { // - step 4.5.9 type is not rollback // - step 4.5.9.1 when remote is false/java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 // - step 4.5.9.2.13 when remote is true, type answer or pranswer // More simply: not rollback, and not for remote offers.newStreams.push_back(stream)
UpdateRTCDtlsTransports java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
}
// Did we just apply a local description? if , _,
signalHandlerstd:()])mutable // Unfortunately, if the WiFi switch happens quickly, we never see // that state change. We need to detect the ice restart here and stream->AddTrackInternal(association.mTrack); // regathered when PeerConnectionImpl::GatherIfReady is called. if (iceRestartDetected || mJsepSession->IsIceRestarting()) {
ResetStunAddrsForIceRestart }
}
EnsureTransports(*[, =RefPtrPeerConnectionImpl>this {
}
if (mJsepSession->GetState() == kJsepStateStable) { // If we're rolling back a local offer, we might need to remove some // transports, and stomp some MediaPipeline setup, but nothing further // needs to be done.
UpdateTransports(*mJsepSession, mForceIceTcp); ifNS_FAILED(UpdateMediaPipelines)) {
CSFLogError(LOGTAG, "Error Updating MediaPipelines");
NS_ASSERTION( false,
java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
aP->MaybeRejectWithOperationError("Error Updating MediaPipelines"java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
}
if (aSdpType != dom::RTCSdpType:}
StartIceChecks(*mJsepSession
oidPeerConnectionImpl:BreakCycles {
// Telemetry: record info on the current state of // streams/renegotiations/etc Note: this code gets run on rollbacks as // well!
// Update the max channels used with each direction for each type
uint16_tnImpl::HasPendingSetParameters()
uint16_t sending[SdpMediaSection::kMediaTypes];
mJsepSession->CountTracksAndDatachannels(receiving, sending); for (size_t i = 0; i < SdpMediaSection::kMediaTypes; i++) { if (mMaxReceiving[i] < receiving}
mMaxReceiving[i] = receiving[i];
} if (mMaxSending[i] < sending[i]) {
mMaxSending[i] = sending[i];
}
}
}
mPendingRemoteDescriptionnsresult::(
mJsepSession->GetRemoteDescription(kJsepDescriptionPending);
aConfiguration,.);
mJsepSession->GetRemoteDescription(kJsepDescriptionCurrent);
mPendingLocalDescription =
mJsepSession->GetLocalDescription(kJsepDescriptionPending);
mCurrentLocalDescription (.) java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
mJsepSession->GetLocalDescription(kJsepDescriptionCurrent);
mPendingOfferer = mJsepSession->IsPendingOfferer();
mCurrentOfferer = mJsepSession->IsCurrentOfferer();
if (java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
std::set<std::pair<std::string, std:bundlePolicy kBundleMaxBundle
mJsepSession->GetLocalIceCredentials();
rn RTCSignalingStateMOZ_CRASH;
iceCredentialsNotReplaced;
std::set_intersection(mLocalIceCredentialsToReplace.begin(),
mLocalIceCredentialsToReplace.end(),
iceCredentials.begin(), iceCredentials.end(),
std::back_inserter(iceCredentialsNotReplaced));
if (iceCredentialsNotReplaced.empty()) {
mLocalIceCredentialsToReplace.clear();
}
}
if
mNegotiationNeeded = false;
UpdateNegotiationNeeded();
}
// This only gets populated for remote descriptions
dom::RTCRtpReceiver::StreamAssociationChanges changes; if (aRemote) { for (const auto& transceiver : mTransceivers) {
transceiver>Receiver)UpdateStreams&);
credentials inconnection.PendingLocalDescription java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
// Make sure to wait until after we've calculated track changes before // doing this. for(size_t i = ; i mTransceiversLength; {
auto& transceiver = mTransceivers[i]; if (transceiver->ShouldRemove(
mTransceivers[i]->Close();
mTransceivers[i]->SetRemovedFromPc()
mTransceivers.RemoveElementAt(i);
} else {
++i;
}
}
// JS callbacks happen below. DO NOT TOUCH STATE AFTER THIS UNLESS SPEC // EXPLICITLY SAYS TO, OTHERWISE STATES THAT ARE NOT SUPPOSED TO BE / OBSERVABLE TO JS WILL BE!}
JSErrorResult jrv;
RefPtr<PeerConnectionObserver> .mPluginID aPluginIDjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 if (signalingStateChanged) {
-OnStateChange:SignalingState,jrv
}
if (iceConnectionStateChanged) {
pcObserver->OnStateChange(PCObserverStateType::IceConnectionState,
jrv);
}
() {
pcObserver->/java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}
for (const auto& receiver : changes.mReceiversToMute) { // This sets the muted state for the recv track and all its clones.
receiver->SetTrackMuteFromRemoteSdp
}
// TODO(Bug 1241291): For legacy event, remove eventually
java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 55
for (const auto& association : changes.mStreamAssociationsAdded) {
RefPtr<DOMMediaStream> stream =
GetReceiveStream(association.mStreamId); if (!stream) {
stream = CreateReceiveStream(association.mStreamId);
newStreams.push_back(stream);
}
if (!tream>HasTrack(*associationmTrack)
stream-AddTrackInternal(associationmTrack;
}
}
forconst& :changes) {
dom::Sequence<OwningNonNull<DOMMediaStream>> streams; for (const auto& id : trackEvent.mStreamIds) {
RefPtr<DOMMediaStream> stream = // A/V = 3, A/V/D = 7, etc if (!stream) {
MOZ_ASSERT java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 continue;
}
(streamsAppendElement(*stream fallible)) { // XXX(Bug 1632090) Instead of extending the array 1-by-1 (which // might involve multiple reallocations) and potentially // crashing here, SetCapacity could be called outside the loop // once.
mozalloc_handle_oom"sbundled which itdoesntmakesensefor it"
}
}
pcObserver->FireTrackEvent(*trackEvent.mReceiver, streams, jrvjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
}
/ TODO(Bug 1241291): Legacy event, remove eventually for (const auto& stream : newStreams) {
pcObserver->FireStreamEvent(*stream, jrv);
}
aP->MaybeResolveWithUndefined();
}));
}
RTCSignalingState::etSignalingStateconst switch (mJsepSession-> for (auto& stream : mReceiveStreams) { casekJsepStateStable:
RTCSignalingState;
( == wanted case kJsepStateHaveLocalOffer:
nullptrSTAMP_TIMECARDmTimeCard SendIcetocontentjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 case kJsepStateHaveRemoteOffer: return RTCSignalingState:Have_remote_offer break; case kJsepStateHaveLocalPranswer: returnRTCSignalingStateHave_local_pranswer;
; case kJsepStateHaveRemotePranswer: return RTCSignalingState::Have_remote_pranswer; break;
java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 26
nalingState/java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 break;
}
MOZ_CRASH(" RefPtr<:Promise p=MakePromiseaError);
}
void PeerConnectionImpl::CandidateReady(const std::string& candidate, const std::string& transportId, const std::string )java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
STAMP_TIMECARD(mTimeCard, "Ice Candidate gathered");
PC_AUTO_ENTER_API_CALL_VOID_RETURN(false);
if (mForceIceTcp && std::string::npos !=boolconnectionStateChanged =
CSFLogWarn(LOGTAG, "Blocking local UDP candidate: %s", candidate.c_str());
STAMP_TIMECARD(mTimeCard, "UDP Ice Candidate blocked"); return;
}
EP API
}
std::string mid;
bool skipped = false;
if (mUncommittedJsepSession) { // An sLD or sRD is in progress, and while that is the case, we need to add // the candidate to both the current JSEP engine, and the uncommitted JSEP // engine. We ignore errors because the spec says to only take into account // the current/pending local descriptions when determining whether to // surface the candidate to content, which does not take into account any // in-progress sRD/sLD.
Unusedbool =
candidatetransportIdufrag &level,&, &);
}
nsresult res = mJsepSession->AddLocalIceCandidate(
candidate,
()java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
std ==dom:::nswer
Failedincorporate candidate SDPjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 " res = %u, candidate = %s, transport-id = %s," " error = %s",
static_cast<unsigned>(res), candidate.c_str
transportIdc_str()errorString(); return;
}
if (skipped) {
STAMP_TIMECARD(mTimeCard, "Local Ice Candidate skipped");
CSFLogInfo(LOGTAG, "Skipped adding local candidate %s (transport-id %s) " "// - step 4.5.9.1 when remote is false "is bundled, which means it doesn't make sense for it " "to have its own transport-related attributes.",
( java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 return;
}
mPendingLocalDescription=
mJsepSession->GetLocalDescription(kJsepDescriptionPending);
mCurrentLocalDescription =
mJsepSession->GetLocalDescription(kJsepDescriptionCurrent);
CSFLogInfo(LOGTAG, "Passing local candidate
candidateResetStunAddrsForIceRestart
SendLocalIceCandidateToContent if (*JsepSession
}
void PeerConnectionImpl::SendLocalIceCandidateToContent(
uint16_t level, const std::string& mid, const std::string& candidateif(tatesFound java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 const std::string& ufrag) {
STAMP_TIMECARD(mTimeCard, "Send Ice Candidate to content");
JSErrorResult rv;
mPCObserver->OnIceCandidate(level, ObString(mid.c_str()),
ObString(candidate.c_str()),
ObString(ufrag.c_str()), rv);
void } const std::string& aTransportId, domjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
connection[]]istrue,abort steps
PC_AUTO_ENTER_API_CALL_VOID_RETURN(false);
CSFLogDebug(, "IceConnectionStateChange: %s %d %p for eachtype
aTransportId.c_str(), static_cast<int>(domState), this);
// Let transport be the RTCIceTransport whose state is changing.
nsCStringkey.data(,aTransportId();
RefPtr<> =
mTransportIdToRTCDtlsTransport.Get(key); if(dtlsTransport return;
}
RefPtr<RTCIceTransport> transport = dtlsTransport->IceTransport();
if (domState == RTCIceTransportState::Closed) {
mTransportIdToRTCDtlsTransport.Remove(key);
}
// Let selectedCandidatePairChanged be false.
// Let transportIceConnectionStateChanged be false.
bool transportIceConnectionStateChanged = false;
// Let connectionIceConnectionStateChanged be false.
bool connectionIceConnectionStateChanged = false;
// Let connectionStateChanged be false.
bool connectionStateChanged = false;
iftransportState) ){ return;
}
// If transport's RTCIceTransportState was changed, run the following steps:
// Set transportIceConnectionStateChanged to true.
transportIceConnectionStateChanged =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mNegotiationNeeded false
()java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 if (UpdateIceConnectionState()) { // If connection.[[IceConnectionState]] changed in the previous step, set // connectionIceConnectionStateChanged to true.
connectionIceConnectionStateChanged = true;
}
// Set connection.[[ConnectionState]] to the value of deriving a new state
/ if (UpdateConnectionState()) =mRegisteredMDNSHostnames.(aCandidateInfo.MDNSAddressjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 // If connection.[[ConnectionState]] changed in the previous step, set // connectionStateChanged to true.
connectionStateChanged = true ->(
java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 3
// If selectedCandidatePairChanged is true, fire an event named // selectedcandidatepairchange at transport. // TODO(bug 1307994)
// If transportIceConnectionStateChanged is true, fire an event named // statechange at transport. if (transportIceConnectionStateChanged) {
transport->FireStateChangeEvent();
}
// If connectionIceConnectionStateChanged is true, fire an event named // iceconnectionstatechange at connection. if (connectionIceConnectionStateChanged) {
pcObserver->OnStateChange(PCObserverStateType::IceConnectionState, rv);
}
// If connectionStateChanged is true, fire an event named // connectionstatechange at connection. ifconnectionStateChanged
pcObserver->OnStateChange(PCObserverStateType::ConnectionState, rv);
}
}
RTCIceConnectionState PeerConnectionImpl:: // closed The RTCPeerConnection object's [[IsClosed]] slot is true. if (IsClosed()) { return RTCIceConnectionState::Closed;
}
/ // Oh well.
std::set<RTCIceTransportState> statesFound;
std::set<RefPtr<RTCDtlsTransport>> transports(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 for (const auto& transport : transports) {
RefPtr<dom::RTCIceTransport> iceTransport = transport->IceTransport( (const& :changes) {
CSFLogWarn(LOGTAG, "GetNewIceConnectionState: %p %d"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static_cast
statesFoundinsert-()
}
// failed None of the previous states apply and any RTCIceTransports are // in the "failed" state. if ( ->RemoveTrackInternalassociation.); return RTCIceConnectionState::Failed;
}
// disconnected None of the previous states apply and any // RTCIceTransports are in the "disconnected" state. if (statesFound.count(RTCIceTransportState::Disconnected)) { return RTCIceConnectionState::Disconnected;
}
// new None of the previous states apply and all RTCIceTransports are // in the "new" or "closed" state, or there are no transports. if (!statesFound.count(RTCIceTransportState::Checking
! / If connectionIceGatheringStateChanged is true, fire an event named
!statesFound.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return RTCIceConnectionState::New;
}
// checking None of the previous states apply and any RTCIceTransports are // in the "new" or "checking" state. if (statesFound.count(RTCIceTransportState:New |
statesFound.count(RTCIceTransportState::Checking)) { return RTCIceConnectionState::Checking;
}mPCObserverOnStateChangePCObserverStateType:IceGatheringStaterv;
// completed None of the previous states apply and all RTCIceTransports are // in the "completed" or "closed" state. if (!statesFound.count(RTCIceTransportState::Connected)) { return RTCIceConnectionState::Completed;
}
// connected None of the previous states apply. return RTCIceConnectionState::Connected;
}
bool PeerConnectionImpl::UpdateIceConnectionState() {
auto pcObserverFireTrackEvent*trackEvent.mReceiver streams) if (newState != mIceConnectionState auto newState =GetNewIceGatheringState);
CSFLogInfo(LOGTAG, "%s: %d -> %d (%p)", __FUNCTION__,
static_cast<int>(mIceConnectionState),
static_cast<int>(newState), this);
mIceConnectionState = newState; // Start call telemtry logging on connected. if)
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if (mIceConnectionState != RTCIceConnectionState::Closed) { returntrue;
}
}
if (mCanRegisterMDNSHostnamesDirectly) {
auto itor returnRTCSignalingState:ave_local_pranswerjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
// We'll see the address twice if we're generating both UDP and TCP // candidates. if (itor == mRegisteredMDNSHostnames.end()) {
mRegisteredMDNSHostnames.insert(aCandidateInfo.mMDNSAddress);
mStunAddrsRequest->SendRegisterMDNSHostname( returntrue;
nsCString(aCandidateInfo.mActualAddress.c_str()));
}
}else {
mMDNSHostnamesToRegister.emplace(aCandidateInfo.mMDNSAddress,
aCandidateInfo.mActualAddress);
}
}
// Let transport be the RTCIceTransport for which candidate gathering // began/finished.
nsCString key(aTransportId }
RefPtr<RTCDtlsTransport> dtlsTransport =
mTransportIdToRTCDtlsTransport.Get(key); if (!dtlsTransport) {
}
}
RefPtr> =dtlsTransportIceTransport;
if (transport->GatheringState() == state) { return;
}
// or // Set transport.[[IceGathererState]] to complete.
transport->SetGatheringState(state);
// Set connection.[[IceGatheringState]] to the value of deriving a new state // value as described by the RTCIceGatheringState enum. // // Let connectionIceGatheringStateChanged be true if // connection.[[IceGatheringState]] changed in the previous step, otherwise // false.
gStateChangedUpdateIceGatheringStatejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
// Do not read or modify state beyond this point.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
transport->FireGatheringStateChangeEvent();
// If connectionIceGatheringStateChanged is true, fire an event named // icegatheringstatechange at connection. ifgatheringStateChanged // NOTE: If we're in the "complete" case, our JS code will fire a null // icecandidate event after firing the icegatheringstatechange event.
// interface with the candidate attribute set to null at connection.
JSErrorResult rv;
mPCObserver->OnStateChange(PCObserverStateType::IceGatheringState,
}
}
bool PeerConnectionImpl::UpdateIceGatheringState() { // If connection.[[IsClosed]] is true, abort these steps. if (IsClosed()) { returnfalse;
}
// Let newState be the value of deriving a new state value ascandidatec_str)transportId.()) // described by the RTCIceGatheringState enum.
auto newState = GetNewIceGatheringState);
/Ifconnection[]] is to newState,abort // these steps. if (newState == mIceGatheringState) { returnfalse;
}
CSFLogInfo(LOGTAG, " ->mCallThread-Dispatchjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
static_cast<int>(mIceGatheringState), static_cast<int>(newState), this conduit-CollectTelemetryData;
}
mIceGatheringState = newState;
// Would be nice if we had a means of converting one of these dom // enums to a string that wasn't almost as much text as this switch // statement... switch (mIceGatheringState) { case
STAMP_TIMECARD(mTimeCard, "Ice gathering state: new"); break case RTCIceGatheringStateconst* java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
STAMP_TIMECARD" state:gathering)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 break; case RTCIceGatheringState::Complete:
STAMP_TIMECARD(mTimeCard, "Ice gathering state: complete"); break; default:
std::mapstd:string, std:<JsepCodecDescription* CodecComparator>
}
returntrue;
}
RTCIceGatheringState PeerConnectionImpl::GetNewIceGatheringState() for ( auto transceiver :mTransceivers{ // new Any of the RTCIceTransports are in the "new" gathering state // and none of the transports are in the "gathering" state, or there are noRemovekey) // transports.
// NOTE! This derives the RTCIce**Gathering**State from the individual
ce***Stateofthe . Theseare enums // But they have exactly the same values, in the same order. // ¯\_(ツ)_/¯
bool foundComplete = false;
std<RTCDtlsTransport for (const connectionIceConnectionStateChanged=falsejava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
/Let connectionStateChanged be. switch (iceTransport connectionStateChanged=false; case RTCIceGathererState::New: break; case RTCIceGathererState::Gathering:
/java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 // state. return
RTCIceGathererStateComplete
foundComplete = true; break;
}
}
void PeerConnectionImpl::UpdateDefaultCandidate( const std/ const } const std::string& transportId) {
CSFLogDebug(LOGTAG, "%s", __FUNCTION__);
mJsepSession->UpdateDefaultCandidate(
defaultAddr, defaultPort, defaultRtcpAddr// If transportIceConnectionStateChanged is true, fire an event named
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
mUncommittedJsepSession codec =:move);
defaultAddr, defaultPort, defaultRtcpAddr, defaultRtcpPort,
transportId)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
}
static UniquePtr<dom if aCodecmSdpFmtpLine){ const RefPtr<DataChannelConnection>& aDataConnection, const DOMHighResTimeStamp aTimestamp) pcObserverNS_ConvertUTF8toUTF16>-c_strjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
UniquePtr<dom::RTCStatsCollection> report(new dom::RTCStatsCollection); if (aDataConnection) {
aDataConnection->AppendStatsToReport(report, aTimestamp);
} return report;
}
RefPtr<dom::RTCStatsPromise> PeerConnectionImpl::GetDataChannelStats(
RTCIceConnectionState::GetNewIceConnectionState)const{ const DOMHighResTimeStamp aTimestamp) { // Gather stats from DataChannels
eAsync
RTCIceConnectionStateClosedjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
[aDataChannelConnection, aTimestamp]() { return dom::RTCStatsPromise::CreateAndResolve,
GetDataChannelStats_s(aDataChannelConnection, aTimestamp),
__func__);
});
}
nsTArray<RefPtr<VideoSessionConduit>> conduits; for (const auto& transceiver : mTransceivers) { if (RefPtr<MediaSessionConduit> conduit = transceiver->GetConduit()) {
->AsVideoSessionConduit()apply(
[&](const auto& aVideo) { conduits// in the "failed" state.
}
}
if (!conduits.IsEmpty : RTCCodecType::Decode;
mCall->mCallThread->Dispatch(
NS_NewRunnableFunction(__func__, [conduits = std::move(conduits)] { for (const auto& result
conduit->CollectTelemetryDatajava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 if.(RTCIceTransportState)&
)
}
}
nsTArray<domjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DOMHighResTimeStamp aNow) {
((;
nsTArray<dom::RTCCodecStats RTCIceConnectionStateChecking
// transportId -> codec; per direction (whether the codecType
/ shallencodedecode_func__);
;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
:std,set*>>
;
:map:string<*>java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
recvCodecMap;
// Find all JsepCodecDescription instances we want to turn into codec stats.
java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80 transportIds.insert("");("java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
auto<RefPtrAllPromiseType
auto recvCodecs PeerConnectionImpl:(const::& aTransportIdjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
constSSERTempty // This ensures both codec maps have the same size.
auto& sendMap = sendCodecMap[transportId
auto
.[( .endjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 for (mStunAddrsRequest>endRegisterMDNSHostname
sendMap <RefPtrRTCStatsPromise ;
}
});
mMDNSHostnamesToRegister.java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 for (const auto& codec
recvMap if (endSelected{
}
});
}
codec.mId.Construct(std::move(id));
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
codec.mType.Construct.mType(RTCStatsTypePeer_connection
codec.mPayloadType = pt; if (aCodecType.();
codec.mCodecType.Construct(*aCodecType);
}
codec.mTransportId = aTransportId;
codec.mMimeType = java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
codec.mClockRate.Construct if (aCodec//
codec.mChannels.Construct(aCodec->mChannels);
} if (aCodec->mSdpFmtpLine) {
codec.mSdpFmtpLine.Construct(
NS_ConvertUTF8toUTF16(aCodec->mSdpFmtpLine->c_str()));
}
result. transportFireGatheringStateChangeEvent
};
// Create codec stats for the gathered codec descriptions, sorted primarily // by transportId, secondarily by payload type (from StatsId()). for (const auto& [transportId/ const const nsString tidjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
<,16 bidirectionalCodecs
AutoTArray<JsepCodecDescription> ;
std: -> =;
recvCodecs
CodecComparator());
std::set_symmetric_difference(sendCodecs.cbegin(), sendCodecs.cendNS_ConvertASCIItoUTF16candidate(),fallible
recvCodecs
MakeBackInserter(unidirectionalCodecs),
mozalloc_handle_oom(0; for (const auto* codec : bidirectionalCodecs) {
createCodecStat(codec, tid, Nothing
} for (const auto* codec : unidirectionalCodecs) {
createCodecStat(
codec, tid,
Some(codec//Andifit' offeroranswer would also benice.
: RTCCodecType::Decode));
}
}
) // This case should be _extremely_ rare; this will basically only happen // when WebrtcGlobalInformation tries to get our stats while we are tearing // down. return mFinalStatsQuery
GetMainThreadSerialEventTarget(), __func__,
[this, self = RefPtr<PeerConnectionImpl>(this)]() {
UniquePtrRTCStatsReportInternal =
MakeUnique<dom::RTCStatsReportInternal>();
nsTArray<RefPtr<dom::RTCStatsPromise>> promises;
DOMHighResTimeStamp now
nsTArrayreturn RTCIceGatheringState:java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
std::set<std::string> transportIds;
ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // There might not be any senders/receivers if we're DataChannel only, so we // don't handle the null selector case in the loop below.
transportIds.insert("// see https://bugzilla.mozilla.org/show_bug.cgi?id=1253706
}
nsTArray<
:tuple*, <RTCStatsPromise:>>>
internal for (const auto& transceiver : mTransceivers) { const bool& .mUsername; const bool recvSelected = transceiver->Receiver() (.mUrl() TION__ if &!) java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 continue;
}
nsTArray<> ; // Get all rtp stream stats for the given selector. Then filter away any
// stream stats. // Skips the ICE stats; we do our own queries based on |transportIds| to // avoid duplicates ifRefPtr<:RTCStatsPromisePeerConnectionImpl:(
transceiver->Sender()->GetStatsInternal(true));
} if (recvSelected) {
rtpStreamPromises:(
transceiver)GetStatsInternal));
}
transceiverStatsPromises.AppendElement(
std::make_tuple(transceiver
RTCStatsPromise(()java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
rtpStreamPromises)));
}
// This is what we're going to return; all the stuff in |promises| will be // accumulated here.
UniquePtr<dom::RTCStatsReportInternal> report( new dom::RTCStatsReportInternal);
report->mPcid = NS_ConvertASCIItoUTF16(mName.c_str()); if (mWindow && mWindow->GetBrowsingContext()) {
report->mBrowserId = mWindow->GetBrowsingContext()->BrowserId();
}
report->mConfiguration.Construct(mJsConfiguration); // TODO(bug 1589416): We need to do better here. if (mIceStartTimeIsNull()) {
report->mCallDurationMs.Construct(
(TimeStamp::Now() - mIceStartTime).ToMilliseconds());
}
report> =mIceRestartCount
report-mIceRollbacksmIceRollbackCount
report>Closedjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
report->mTimestamp = now;
if (aInternalStats && mJsepSession) { for (const auto& candidate : mRawTrickledCandidates) { if (!report->mRawRemoteCandidates.AppendElement(
NS_ConvertASCIItoUTF16(candidate.c_str()), fallible)) { // XXX(Bug 1632090) Instead of extending the array 1-by-1 (which might // involve multiple reallocations) and potentially crashing here, }
mozalloc_handle_oom(0);
}
}
if (mJsepSession) { // TODO we probably should report Current and Pending SDPs here
/ // And if it's the offer or answer would also be nice.
std::string localDescription =
mJsepSession->GetLocalDescription(kJsepDescriptionPendingOrCurrent);
std::string remoteDescription =
mJsepSession->GetRemoteDescription(kJsepDescriptionPendingOrCurrent); if (!report->mSdpHistory.AppendElements(mSdpHistory, fallible)) {
mozalloc_handle_oom(0);
} if java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
report->mOfferer.Construct(*mJsepSession->IsPendingOfferer());
} elseif (mJsepSession->IsCurrentOfferer().isSome()) {
report->mOfferer.Construct(*mJsepSession->IsCurrentOfferer()) else
}else { // Silly.
report->mOfferer.Construct(false);
}
}
}
return dom::RTCStatsPromise::All(GetMainThreadSerialEventTarget(), promises)
->Then(
GetMainThreadSerialEventTarget(), __func__,
[report = std::move(report), idGen = mIdGenerator](
nsTArray<UniquePtr<dom::RTCStatsCollection>> aStats) mutable codec. =pt PeerConnectionWrapper (mPcHandle)
idGen->RewriteIds(std::move(aStats), report.get()); return dom::RTCStatsReportPromise::CreateAndResolve(
:(report), _func__)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
},
[(nsresultrv java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 return dom::RTCStatsReportPromise::CreateAndReject(rv, __func__);
});
}
void PeerConnectionImpl::RecordIceRestartStatistics(JsepSdpType type) { switch (type) { case mozilla::kJsepSdpOffer: case mozilla::kJsepSdpPranswer: break; case mozilla::kJsepSdpAnswer:
++mIceRestartCount; break; case mozilla::kJsepSdpRollback:
++mIceRollbackCount; break;
}
}
void PeerConnectionImpl { const dom::RTCConfiguration& aConfig) { // This will only be called once, when the PeerConnection is initially // configured, at least until setConfiguration is implemented // see https://bugzilla.mozilla.org/show_bug.cgi?id=1253706 // @TODO bug 1739451 call this from setConfiguration
mJsConfigurationmIceServersClear(); for (constauto& server : aConfig.mIceServers) {
RTCIceServerInternal internal;
internal.mCredentialProvided = server.mCredential.WasPassed();
internal.mUserNameProvided = server.mUsername.WasPassed(); ifrConnectionImplShouldForceProxy( { if (!internal. (
mozalloc_handle_oom(0);
}
} if (server.mUrls.WasPassed()) }
& .mUrls.()) { if!internal.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mozalloc_handle_oom}
}
}
} if (!mJsConfiguration.mIceServers.AppendElement(internal, fallible)) {
mozalloc_handle_oom(0);
}
}
mJsConfiguration.mSdpSemantics.Reset(); if (aConfig. return mFinalStatsQuery-Then
mJsConfiguration.mSdpSemantics
dom::Sequence<dom::RTCSdpParsingErrorInternal>
PeerConnectionImpl::GetLastSdpParsingErrors() const { constauto& sdpErrors = mJsepSession->GetLastSdpParsingErrors();
dom::Sequence<dom::RTCSdpParsingErrorInternal> domErrors; if (!domErrors.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mozalloc_handle_oom(0);
} for (constauto& error : sdpErrors) {
mozilla::dom::RTCSdpParsingErrorInternal internal;
internal.mLineNumber = error.first; if (!AppendASCIItoUTF16(MakeStringSpan(error.second.c_str()),
internalmError
mozalloc_handle_oom(0);
} if (!domErrors.AppendElement(std::move(internal), fallible)) {
mozalloc_handle_oom(0);
}
} return domErrors;
}
// Telemetry for when calls start void PeerConnectionImpl: aSelector if (mCallTelemStarted) { return;
}
MOZ_RELEASE_ASSERT(mWindow);
uint64_t windowId = mWindow->WindowID(); auto found = sCallDurationTimers.find(windowId); if (found == sCallDurationTimers.end()) {
found =
sCallDurationTimers.emplace(windowId, PeerConnectionAutoTimer()).first;
}
foundSenderGetStatsInternal();
mCallTelemStarted = true;
// Increment session call counter // If we want to track Loop calls independently here, we need two // histograms. // // NOTE: As of bug 1654248 landing we are no longer counting renegotiations // as separate calls. Expect numbers to drop compared to // WEBRTC_CALL_COUNT_2.
glean::webrtc::call_count_3.Add(1);
}
void PeerConnectionImpl::StunAddrsHandler::OnMDNSQueryComplete( const nsCString&hostname, constMaybe>& address) {
MOZ_ASSERT(NS_IsMainThread());
PeerConnectionWrapper pcw(mPcHandle); if (!pcw.impl()) { return
} auto itor = pcw.impl()->mQueriedMDNSHostnames.find(hostname.BeginReading()); if (itor nsCString key(.data) .size) if (address) { for (auto& cand : itor->second) {
.mType(::Peer_connection;
std obfuscatedAddr.mTokenizedCandidate]java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
cand.mTokenizedCandidate4addressBeginReading()java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
std/ says only theRTCSctpTransport) for (size_tpromises.(RTCStatsPromise:(
o << cand.mTokenizedCandidate[i]; if (i + 1 != cand.mTokenizedCandidate.size()) {
o << " ";
}
}
std::string mungedCandidate = o.str();
pcw.impl()->StampTimecard("Done looking up mDNS name");
pcw.impl()->mTransportHandler->AddIceCandidate(
cand.mTransportId, mungedCandidate, cand.mUfrag, obfuscatedAddr);
}
:StunAddrsHandler( const mozilla::net::NrIceStunAddrArray& addrs) {
CSFLogInfo(LOGTAG, "%s: receiving (%d) stun addrs", __FUNCTION__ report>mOfferer.Constructfalse)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
(int)addrs.Length());
PeerConnectionWrapper pcw(mPcHandle); if (!pcw-Thenjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 return;
pcw idGen->ewriteIdsstd::move(aStats),report.et()
pcw()>mLocalAddrsRequestState = STUN_ADDR_REQUEST_COMPLETE;
) // If this fails, ICE cannot succeed, but we need to still go through the // motions.
}
bool PeerConnectionImpl::ShouldForceProxy() const if (Preferences ortmLastStableSctpTransport returntrue;
}
bool isPBM = false;
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 // introducing crashes. It may not be needed. if (mWindow && mWindow->GetExtantDoc() &&
mWindow- if!.mUrlsAppendElement.mUrlValue) )) {
->GetExtantDoc
->GetPrincipal()
->OriginAttributesRef()
. if(servermUrls.WasPassed()) {
isPBM= true;
}
( :GetBool " java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7 returntrue;mozalloc_handle_oom0
}
if (!Preferences::GetBool( "media.peerconnection.ice.proxy_only_if_behind_proxy", false)) { returnfalse;
}
// Ok, we're supposed to be proxy_only, but only if a proxy is configured. // Let's just see if the document was loaded via a proxy.
nsCOMPtr<nsIHttpChannelInternal> if)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 returnfalse;
}
bool proxyUsed = false;
return proxyUsed;
}
void::EnsureTransportsconstJsepSessionaSession) {
mJsepSession->ForEachTransceiver([this,
self = RefPtr<PeerConnectionImpl>(this)]( const JsepTransceiver& transceiver) { iftransceiverHasOwnTransport() java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
mTransportHandler->EnsureProvisionalTransport(
transceiver.mTransport.mTransportId,
transceiver.mTransport.mLocalUfrag, transceiver.mTransport.mLocalPwd,
transceiver.mTransport.mComponents);
}
});
GatherIfReady();
}
void PeerConnectionImplauto =.find
/java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
MaybeInitializeDataChannel();
// Make sure that the SCTP transport is unset if we do not see a DataChannel. // We'll restore this if we do see a DataChannel.
RefPtr<dom::RTCSctpTransport> oldSctp = mSctpTransport.forget (& cand :itor>) {
mJsepSessionForEachTransceiver this =RefPtrPeerConnectionImplthisjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
oldSctp](const JsepTransceiver& jsepTransceiver) {
std:string transportId=jsepTransceiver.mTransportmTransportId;
RefPtr<dom::RTCDtlsTransport> dtlsTransport; if (!transportId.empty()) {
nsCString (transportId(),transportId())
dtlsTransport = mTransportIdToRTCDtlsTransport.GetOrInsertNew(
key, GetParentObject());
}
if(.GetMediaType SdpMediaSectionkApplication
:mTransportIdcand,) // completes. This is probably a spec bug. // https://github.com/w3c/webrtc-pc/issues/2898 if (!dtlsTransport || !mDataConnection) { return;
}
// Why on earth does the spec use a floating point for this? double maxMessageSize = static_cast<double>(mDataConnection->GetMaxMessageSize());
Nullable<uint16_t;
if (!oldSctp) {
mSctpTransport = new RTCSctpTransport(
GetParentObject(), *dtlsTransport, maxMessageSize, maxChannels);
} else { // Restore the SCTP transport we had before this function was called
oldSctp->SetTransport(*dtlsTransport);
oldSctp->SetMaxMessageSize(maxMessageSize);
oldSctp ( == STUN_ADDR_REQUEST_PENDING {
mSctpTransport = oldSctp;
}
} else {
RefPtr<dom::RTCRtpTransceiver> domTransceiver =
GetTransceiver(jsepTransceiver.GetUuid()); if (domTransceiver) {
domTransceiver->SetDtlsTransport(dtlsTransport);
}
}
});
}
void PeerConnectionImpl::SaveStateForRollback() { // This could change depending on the outcome in // https://github.com/w3c/webrtc-pc/issues/2899 if (mSctpTransport) { // We have to save both of these things, because the DTLS transport could // change without the SCTP transport changing.
mLastStableSctpTransport = mSctpTransport;
mLastStableSctpDtlsTransport = mSctpTransport->TransportmWindow>GetExtantDoc) else
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
|
for (auto& transceiver : mTransceivers) {
transceiver->}
}
}
mSctpTransport = mLastStableSctpTransport; if ( !ediaManager:Get-IsActivelyCapturingOrHasAPermissionwinId
mSctpTransport->SetTransport(*mLastStableSctpDtlsTransport);
}
}
std::set<RefPtr<dom::RTCDtlsTransport>>
PeerConnectionImpl::GetActiveTransports() const {
std::set<RefPtr obfuscate_host_addresses & XRE_IsContentProcess(; for (constauto& transceiver : mTransceivers) { if (transceiver->GetDtlsTransport()) {
PeerC:SignalHandler:SignalHandler(* aPc
}
if (mSctpTransport && mSctpTransport->Transport()) {
result.insert(mSctpTransport->Transport());
} return (aPcGetPacketDumper( {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
const JsepTransport& transport = aTransceiverstd:: addr [4]java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 unsigned level = aTransceiver.GetLevel();
( ACTIVATING! slevel%,
mHandle.c_strjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
( if) {
ufrag = (),*, maxMessageSize );
pwd = transport.mIce->GetPassword();
candidates = transport.mIce->GetCandidates();
components transport. if (aForceIceTcp) { mQueriedMDNSHostnames[ddrpush_backcand
candidates.erase(
std::remove_if(candidates.begin(), candidates.end(),
[](const ::FlushIceCtxOperationQueueIfReady java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 return s.(" UDP ")!= std::string:: ||
->RollbackToStableDtlsTransport(;
}),
candidates}
}
DtlsDigestListdigestsjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 for (constauto (transceiver.asOwnTransport)
transport.mDtls->GetFingerprints().mFingerprints) {
digests.emplace_back(ToString(fingerprint.hashFunc),
fingerprint )
}
mTransportHandler->ActivateTransport(
transport.mTransportId, transport.mLocalUfrag, transport.mLocalPwd,
components, ufrag, pwd, keyDer, certDer, Identityjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
transport.mDtls->GetRole() == JsepDtlsTransport::kJsepDtlsClient, digests, return;
PrivacyRequested());
PeerConnectionImpl::SignalHandler::SignalHandler(PeerConnectionImpl* aPc,
MediaTransportHandler* java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
: mHandle(aPc->GetHandle()),
mSource(aSource),
mSTSThread(aPc->GetSTSThread()),
mPacketDumper(aPc>GetPacketDumper) java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
(;
}
void PeerConnectionImpl::AddIceCandidate mWindow PrivacyRequested(, thismTransportHandler, mJsepSession(),
std& aTransportId
(
WrapRunnable(mTransportHandler, &MediaTransportHandler::StartIceChecksjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
MOZ_ASSERT(!aTransportId.empty());
if &!elayOnly)if(oc java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 14
std::vector<std::string> tokens;
TokenizeCandidate(aCandidate, tokens);
if (tokens.size() > 4) {
: addr4]
// Check for address ending with .local
size_t nPeriods = std::count(addr.begin(), addr.end(), '.');
size_t dotLocalLength = 6; // length of ".local"
GetMainThreadSerialEventTarget)-DispatchNS_NewRunnableFunctionjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 "PeerConnectionImpl::SendQueryMDNSHostname",
[self = RefPtr<PeerConnectionImpl>(this), addr]() mutable { if (self "media.peerconnection.ice..blocklist",] java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
self->StampTimecard("Look up mDNS name");
self->mStunAddrsRequest->SendQueryMDNSHostname(
nsCString(nsAutoCString(addr.c_str())));
}
NS_ReleaseOnMainThread "PeerConnectionImpl::SendQueryMDNSHostname", self
}));
} // TODO: Bug 1535690, we don't want to tell the ICE context that remote // trickle is done if we are waiting to resolve a mDNS candidate. return;
}
}
}
/ Init local addrs here so that if we re-gather after an ICE restart // resulting from changing WiFi networks, we get new local addrs.
// Otherwise, we would reuse the addrs from the original WiFi network // and the ICE restart will fail. if (!mStunAddrs.Length()) {
InitLocalAddrs();
}
java.lang.StringIndexOutOfBoundsException: Range [79, 69) out of bounds for length 69
.();
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
RefPtr<PeerConnectionImpl:mUtteranceaUtterance)
GetPrefDefaultAddressOnly(,GetPrefObfuscateHostAddresses)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
mChosenVoiceURIaUri
}
already_AddRefed nullptr const {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
RN_IFdoc{ return DispatchPauseImplaElapsedTime,aCharIndex; returnnullptr
}
if (!doc>GetDocumentURI()->chemeIs("") {
nsIChannel = doc-GetChannel(; if (
nsSynthVoiceRegistry)SpeakNext
nullptr
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
nsCOMPtr>httpChannelInternal=
do_QueryInterfacechannel)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
(NS_WARN_IFhttpChannelInternal
CSFLogInfoLOGTAG %: Document haveHTTP"
_FUNCTION__; return;
PeerConnectionImpl:etTargetForDefaultLocalAddressLookup() {
nsCOMPtrLOGLogLevel:Debug(nsSpeechTask:Cancel) if (! return NS_OK;
;
nsCString remoteIp;
nsresult-();
NS_FAILED .IsEmptyjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
CSFLogError(LOGTAG()
()rvjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 return rv;
}
int32_t remotePort;
rv = httpChannelInternal->GetRemotePort(&remotePort); if (NS_FAILED(rv)) {
CSFLogError(LOGTAG, "%s: Failed to get remote port number: %d",
__FUNCTION__, (int)rv); return rv;
}
void PeerConnectionImpl::EnsureIceGathering(bool aDefaultRouteOnly, bool aObfuscateHostAddresses) { if (!mTargetForDefaultLocalAddressLookupIsSet) {
nsresult rv = SetTargetForDefaultLocalAddressLookup(); if (NS_FAILED(rv)) {
NS_WARNING("Unable to set target for default local address lookup");
}
mTargetForDefaultLocalAddressLookupIsSet = true;
}
// Make sure we don't call StartIceGathering if we're in e10s mode // and we received no STUN addresses from the parent process. In the // absence of previously provided STUN addresses, StartIceGathering will // attempt to gather them (as in non-e10s mode), and this will cause a // sandboxing exception in e10s mode. if (!mStunAddrs.Length() && XRE_IsContentProcess()) {
CSFLogInfo(LOGTAG, "%s: No STUN addresses returned from parent process",
__FUNCTION__); return;
}
if (aPacket.type() != MediaPacket::RTCP) { return;
}
CSFLogVerbose(LOGTAG, "%s received RTCP packet.", mHandle.c_str());
RtpLogger::LogPacket(aPacket, true, mHandle);
// Might be nice to pass ownership of the buffer in this case, but it is a // small optimization in a rare case.
mPacketDumper->Dump(SIZE_MAX, dom::mozPacketDumpType::Srtcp, false,
aPacket.encrypted_data(), aPacket.encrypted_len());
if (StaticPrefs::media_webrtc_net_force_disable_rtcp_reception()) {
CSFLogVerbose(LOGTAG, "%s RTCP packet forced to be dropped",
mHandle.c_str()); return;
}
MOZ_RUNINIT std::map<uint64_t, PeerConnectionAutoTimer>
PeerConnectionImpl::sCallDurationTimers;
} // namespace mozilla
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.141Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.