mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1680771: Use a real LoadInfo for WebrtcTCPSocket, ensure we use that LoadInfo's CookieJarSettings for our DNS/proxy lookup, and remove a flag that was breaking http proxy support for webrtc. r=timhuang,mjf
Differential Revision: https://phabricator.services.mozilla.com/D99362
This commit is contained in:
parent
d9b7eb8e14
commit
0c10fa6898
@ -870,10 +870,16 @@ std::unique_ptr<NrSocketProxyConfig> 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<nsILoadInfo> 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<net::LoadInfoArgs> loadInfoArgs;
|
||||
MOZ_ALWAYS_SUCCEEDS(
|
||||
|
@ -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<nsILoadInfo> channelLoadInfo = localChannel->LoadInfo();
|
||||
nsCOMPtr<nsICookieJarSettings> cookieJarSettings;
|
||||
loadInfo->GetCookieJarSettings(getter_AddRefs(cookieJarSettings));
|
||||
channelLoadInfo->SetCookieJarSettings(cookieJarSettings);
|
||||
|
||||
RefPtr<nsHttpChannel> httpChannel;
|
||||
CallQueryInterface(localChannel, httpChannel.StartAssignment());
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user