diff --git a/dom/media/webrtc/jsapi/PeerConnectionMedia.cpp b/dom/media/webrtc/jsapi/PeerConnectionMedia.cpp index 17accaa39ff5..eb3b6df173a1 100644 --- a/dom/media/webrtc/jsapi/PeerConnectionMedia.cpp +++ b/dom/media/webrtc/jsapi/PeerConnectionMedia.cpp @@ -870,10 +870,16 @@ std::unique_ptr PeerConnectionMedia::GetProxyConfig() return nullptr; } + Document* doc = mParent->GetWindow()->GetExtantDoc(); + if (NS_WARN_IF(!doc)) { + NS_WARNING("Unable to get document from window"); + return nullptr; + } + TabId id = browserChild->GetTabId(); nsCOMPtr loadInfo = - new net::LoadInfo(nsContentUtils::GetSystemPrincipal(), nullptr, nullptr, - 0, nsIContentPolicy::TYPE_INVALID); + new net::LoadInfo(doc->NodePrincipal(), doc->NodePrincipal(), doc, 0, + nsIContentPolicy::TYPE_INVALID); Maybe loadInfoArgs; MOZ_ALWAYS_SUCCEEDS( diff --git a/dom/media/webrtc/transport/ipc/WebrtcTCPSocket.cpp b/dom/media/webrtc/transport/ipc/WebrtcTCPSocket.cpp index 697607cfb152..0a7a76f6ba05 100644 --- a/dom/media/webrtc/transport/ipc/WebrtcTCPSocket.cpp +++ b/dom/media/webrtc/transport/ipc/WebrtcTCPSocket.cpp @@ -14,6 +14,7 @@ #include "nsILoadInfo.h" #include "nsIProtocolProxyService.h" #include "nsIURIMutator.h" +#include "nsICookieJarSettings.h" #include "nsProxyRelease.h" #include "nsString.h" #include "mozilla/dom/ContentProcessManager.h" @@ -386,7 +387,7 @@ nsresult WebrtcTCPSocket::OpenWithHttpProxy() { // Proxy flags are overridden by SetConnectOnly() 0, loadInfo->LoadingNode(), loadInfo->GetLoadingPrincipal(), loadInfo->TriggeringPrincipal(), - nsILoadInfo::SEC_DONT_FOLLOW_REDIRECTS | nsILoadInfo::SEC_COOKIES_OMIT | + nsILoadInfo::SEC_COOKIES_OMIT | // We need this flag to allow loads from any origin since this channel // is being used to CONNECT to an HTTP proxy. nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL, @@ -396,6 +397,11 @@ nsresult WebrtcTCPSocket::OpenWithHttpProxy() { return rv; } + nsCOMPtr channelLoadInfo = localChannel->LoadInfo(); + nsCOMPtr cookieJarSettings; + loadInfo->GetCookieJarSettings(getter_AddRefs(cookieJarSettings)); + channelLoadInfo->SetCookieJarSettings(cookieJarSettings); + RefPtr httpChannel; CallQueryInterface(localChannel, httpChannel.StartAssignment()); diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate.c b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate.c index d3c8d00f8b35..3c02181a6514 100644 --- a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate.c +++ b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate.c @@ -271,7 +271,7 @@ int nr_ice_peer_peer_rflx_candidate_create(nr_ice_ctx *ctx,char *label, nr_ice_c static void nr_ice_candidate_mark_done(nr_ice_candidate *cand, int state) { - if (!cand || !cand->done_cb) { + if (!cand) { assert(0); return; } @@ -294,7 +294,9 @@ static void nr_ice_candidate_mark_done(nr_ice_candidate *cand, int state) cand->done_cb=0; cand->state=state; /* This might destroy cand! */ - done_cb(0,0,cand->cb_arg); + if (done_cb) { + done_cb(0,0,cand->cb_arg); + } } int nr_ice_candidate_destroy(nr_ice_candidate **candp)