Пример #1
0
void PeerConnectionBackend::addIceCandidate(RTCIceCandidate& iceCandidate, PeerConnection::VoidPromise&& promise)
{
    ASSERT(m_peerConnection.internalSignalingState() != PeerConnectionStates::SignalingState::Closed);

    if (iceCandidate.sdpMid().isNull() && !iceCandidate.sdpMLineIndex()) {
        promise.reject(Exception { TypeError, ASCIILiteral("Trying to add a candidate that is missing both sdpMid and sdpMLineIndex") });
        return;
    }
    m_addIceCandidatePromise = WTFMove(promise);
    doAddIceCandidate(iceCandidate);
}
static v8::Handle<v8::Value> sdpMLineIndexAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    RTCIceCandidate* imp = V8RTCIceCandidate::toNative(info.Holder());
    return v8Integer(imp->sdpMLineIndex(), info.GetIsolate());
}