зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1755902 - P1: Rename nsIDNSResolverInfo to nsIDNSAdditionalInfo and add port, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D141717
This commit is contained in:
Родитель
91f3123417
Коммит
974130bad4
|
@ -114,7 +114,7 @@ class DNSLookup {
|
|||
this.usedDomain,
|
||||
Ci.nsIDNSService.RESOLVE_TYPE_DEFAULT,
|
||||
Ci.nsIDNSService.RESOLVE_BYPASS_CACHE,
|
||||
gDNSService.newTRRResolverInfo(this.trrServer),
|
||||
gDNSService.newAdditionalInfo(this.trrServer, -1),
|
||||
this,
|
||||
Services.tm.currentThread,
|
||||
{}
|
||||
|
|
|
@ -328,7 +328,7 @@ nsresult HTMLDNSPrefetch::CancelPrefetch(
|
|||
nsresult rv = sDNSService->CancelAsyncResolveNative(
|
||||
NS_ConvertUTF16toUTF8(hostname), nsIDNSService::RESOLVE_TYPE_DEFAULT,
|
||||
flags | nsIDNSService::RESOLVE_SPECULATE,
|
||||
nullptr, // resolverInfo
|
||||
nullptr, // AdditionalInfo
|
||||
sDNSListener, aReason, aPartitionedPrincipalOriginAttributes);
|
||||
|
||||
if (StaticPrefs::network_dns_upgrade_with_https_rr() ||
|
||||
|
@ -336,7 +336,7 @@ nsresult HTMLDNSPrefetch::CancelPrefetch(
|
|||
Unused << sDNSService->CancelAsyncResolveNative(
|
||||
NS_ConvertUTF16toUTF8(hostname), nsIDNSService::RESOLVE_TYPE_HTTPSSVC,
|
||||
flags | nsIDNSService::RESOLVE_SPECULATE,
|
||||
nullptr, // resolverInfo
|
||||
nullptr, // AdditionalInfo
|
||||
sDNSListener, aReason, aPartitionedPrincipalOriginAttributes);
|
||||
}
|
||||
return rv;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "nsHostResolver.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "prsystem.h"
|
||||
#include "DNSResolverInfo.h"
|
||||
#include "DNSAdditionalInfo.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
@ -66,11 +66,12 @@ ChildDNSService::ChildDNSService() {
|
|||
}
|
||||
|
||||
void ChildDNSService::GetDNSRecordHashKey(
|
||||
const nsACString& aHost, const nsACString& aTrrServer, uint16_t aType,
|
||||
const OriginAttributes& aOriginAttributes, uint32_t aFlags,
|
||||
const nsACString& aHost, const nsACString& aTrrServer, int32_t aPort,
|
||||
uint16_t aType, const OriginAttributes& aOriginAttributes, uint32_t aFlags,
|
||||
uintptr_t aListenerAddr, nsACString& aHashKey) {
|
||||
aHashKey.Assign(aHost);
|
||||
aHashKey.Assign(aTrrServer);
|
||||
aHashKey.AppendInt(aPort);
|
||||
aHashKey.AppendInt(aType);
|
||||
|
||||
nsAutoCString originSuffix;
|
||||
|
@ -83,7 +84,7 @@ void ChildDNSService::GetDNSRecordHashKey(
|
|||
|
||||
nsresult ChildDNSService::AsyncResolveInternal(
|
||||
const nsACString& hostname, uint16_t type, uint32_t flags,
|
||||
nsIDNSResolverInfo* aResolver, nsIDNSListener* listener,
|
||||
nsIDNSAdditionalInfo* aInfo, nsIDNSListener* listener,
|
||||
nsIEventTarget* target_, const OriginAttributes& aOriginAttributes,
|
||||
nsICancelable** result) {
|
||||
if (XRE_IsContentProcess()) {
|
||||
|
@ -126,9 +127,9 @@ nsresult ChildDNSService::AsyncResolveInternal(
|
|||
listener = new DNSListenerProxy(listener, target);
|
||||
}
|
||||
|
||||
RefPtr<DNSRequestSender> sender =
|
||||
new DNSRequestSender(hostname, DNSResolverInfo::URL(aResolver), type,
|
||||
aOriginAttributes, flags, listener, target);
|
||||
RefPtr<DNSRequestSender> sender = new DNSRequestSender(
|
||||
hostname, DNSAdditionalInfo::URL(aInfo), DNSAdditionalInfo::Port(aInfo),
|
||||
type, aOriginAttributes, flags, listener, target);
|
||||
RefPtr<DNSRequestActor> dnsReq;
|
||||
if (resolveDNSInSocketProcess) {
|
||||
dnsReq = new DNSRequestParent(sender);
|
||||
|
@ -142,8 +143,9 @@ nsresult ChildDNSService::AsyncResolveInternal(
|
|||
{
|
||||
MutexAutoLock lock(mPendingRequestsLock);
|
||||
nsCString key;
|
||||
GetDNSRecordHashKey(hostname, DNSResolverInfo::URL(aResolver), type,
|
||||
aOriginAttributes, flags, originalListenerAddr, key);
|
||||
GetDNSRecordHashKey(hostname, DNSAdditionalInfo::URL(aInfo),
|
||||
DNSAdditionalInfo::Port(aInfo), type, aOriginAttributes,
|
||||
flags, originalListenerAddr, key);
|
||||
mPendingRequests.GetOrInsertNew(key)->AppendElement(sender);
|
||||
}
|
||||
|
||||
|
@ -155,7 +157,7 @@ nsresult ChildDNSService::AsyncResolveInternal(
|
|||
|
||||
nsresult ChildDNSService::CancelAsyncResolveInternal(
|
||||
const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
|
||||
nsIDNSResolverInfo* aResolver, nsIDNSListener* aListener, nsresult aReason,
|
||||
nsIDNSAdditionalInfo* aInfo, nsIDNSListener* aListener, nsresult aReason,
|
||||
const OriginAttributes& aOriginAttributes) {
|
||||
if (mDisablePrefetch && (aFlags & RESOLVE_SPECULATE)) {
|
||||
return NS_ERROR_DNS_LOOKUP_QUEUE_FULL;
|
||||
|
@ -165,8 +167,9 @@ nsresult ChildDNSService::CancelAsyncResolveInternal(
|
|||
nsTArray<RefPtr<DNSRequestSender>>* hashEntry;
|
||||
nsCString key;
|
||||
uintptr_t listenerAddr = reinterpret_cast<uintptr_t>(aListener);
|
||||
GetDNSRecordHashKey(aHostname, DNSResolverInfo::URL(aResolver), aType,
|
||||
aOriginAttributes, aFlags, listenerAddr, key);
|
||||
GetDNSRecordHashKey(aHostname, DNSAdditionalInfo::URL(aInfo),
|
||||
DNSAdditionalInfo::Port(aInfo), aType, aOriginAttributes,
|
||||
aFlags, listenerAddr, key);
|
||||
if (mPendingRequests.Get(key, &hashEntry)) {
|
||||
// We cancel just one.
|
||||
hashEntry->ElementAt(0)->Cancel(aReason);
|
||||
|
@ -182,7 +185,7 @@ nsresult ChildDNSService::CancelAsyncResolveInternal(
|
|||
NS_IMETHODIMP
|
||||
ChildDNSService::AsyncResolve(const nsACString& hostname,
|
||||
nsIDNSService::ResolveType aType, uint32_t flags,
|
||||
nsIDNSResolverInfo* aResolver,
|
||||
nsIDNSAdditionalInfo* aInfo,
|
||||
nsIDNSListener* listener, nsIEventTarget* target_,
|
||||
JS::HandleValue aOriginAttributes, JSContext* aCx,
|
||||
uint8_t aArgc, nsICancelable** result) {
|
||||
|
@ -194,25 +197,27 @@ ChildDNSService::AsyncResolve(const nsACString& hostname,
|
|||
}
|
||||
}
|
||||
|
||||
return AsyncResolveInternal(hostname, aType, flags, aResolver, listener,
|
||||
target_, attrs, result);
|
||||
return AsyncResolveInternal(hostname, aType, flags, aInfo, listener, target_,
|
||||
attrs, result);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ChildDNSService::AsyncResolveNative(
|
||||
const nsACString& hostname, nsIDNSService::ResolveType aType,
|
||||
uint32_t flags, nsIDNSResolverInfo* aResolver, nsIDNSListener* listener,
|
||||
nsIEventTarget* target_, const OriginAttributes& aOriginAttributes,
|
||||
nsICancelable** result) {
|
||||
return AsyncResolveInternal(hostname, aType, flags, aResolver, listener,
|
||||
target_, aOriginAttributes, result);
|
||||
ChildDNSService::AsyncResolveNative(const nsACString& hostname,
|
||||
nsIDNSService::ResolveType aType,
|
||||
uint32_t flags, nsIDNSAdditionalInfo* aInfo,
|
||||
nsIDNSListener* listener,
|
||||
nsIEventTarget* target_,
|
||||
const OriginAttributes& aOriginAttributes,
|
||||
nsICancelable** result) {
|
||||
return AsyncResolveInternal(hostname, aType, flags, aInfo, listener, target_,
|
||||
aOriginAttributes, result);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ChildDNSService::NewTRRResolverInfo(const nsACString& aTrrURL,
|
||||
nsIDNSResolverInfo** aResolver) {
|
||||
RefPtr<DNSResolverInfo> res = new DNSResolverInfo(aTrrURL);
|
||||
res.forget(aResolver);
|
||||
ChildDNSService::NewAdditionalInfo(const nsACString& aTrrURL, int32_t aPort,
|
||||
nsIDNSAdditionalInfo** aInfo) {
|
||||
RefPtr<DNSAdditionalInfo> res = new DNSAdditionalInfo(aTrrURL, aPort);
|
||||
res.forget(aInfo);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -220,7 +225,7 @@ NS_IMETHODIMP
|
|||
ChildDNSService::CancelAsyncResolve(const nsACString& aHostname,
|
||||
nsIDNSService::ResolveType aType,
|
||||
uint32_t aFlags,
|
||||
nsIDNSResolverInfo* aResolver,
|
||||
nsIDNSAdditionalInfo* aInfo,
|
||||
nsIDNSListener* aListener, nsresult aReason,
|
||||
JS::HandleValue aOriginAttributes,
|
||||
JSContext* aCx, uint8_t aArgc) {
|
||||
|
@ -232,17 +237,17 @@ ChildDNSService::CancelAsyncResolve(const nsACString& aHostname,
|
|||
}
|
||||
}
|
||||
|
||||
return CancelAsyncResolveInternal(aHostname, aType, aFlags, aResolver,
|
||||
aListener, aReason, attrs);
|
||||
return CancelAsyncResolveInternal(aHostname, aType, aFlags, aInfo, aListener,
|
||||
aReason, attrs);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ChildDNSService::CancelAsyncResolveNative(
|
||||
const nsACString& aHostname, nsIDNSService::ResolveType aType,
|
||||
uint32_t aFlags, nsIDNSResolverInfo* aResolver, nsIDNSListener* aListener,
|
||||
uint32_t aFlags, nsIDNSAdditionalInfo* aInfo, nsIDNSListener* aListener,
|
||||
nsresult aReason, const OriginAttributes& aOriginAttributes) {
|
||||
return CancelAsyncResolveInternal(aHostname, aType, aFlags, aResolver,
|
||||
aListener, aReason, aOriginAttributes);
|
||||
return CancelAsyncResolveInternal(aHostname, aType, aFlags, aInfo, aListener,
|
||||
aReason, aOriginAttributes);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -367,8 +372,9 @@ void ChildDNSService::NotifyRequestDone(DNSRequestSender* aDnsRequest) {
|
|||
|
||||
nsCString key;
|
||||
GetDNSRecordHashKey(aDnsRequest->mHost, aDnsRequest->mTrrServer,
|
||||
aDnsRequest->mType, aDnsRequest->mOriginAttributes,
|
||||
originalFlags, originalListenerAddr, key);
|
||||
aDnsRequest->mPort, aDnsRequest->mType,
|
||||
aDnsRequest->mOriginAttributes, originalFlags,
|
||||
originalListenerAddr, key);
|
||||
|
||||
nsTArray<RefPtr<DNSRequestSender>>* hashEntry;
|
||||
|
||||
|
|
|
@ -39,19 +39,19 @@ class ChildDNSService final : public DNSServiceBase, public nsPIDNSService {
|
|||
virtual ~ChildDNSService() = default;
|
||||
|
||||
void MOZ_ALWAYS_INLINE GetDNSRecordHashKey(
|
||||
const nsACString& aHost, const nsACString& aTrrServer, uint16_t aType,
|
||||
const OriginAttributes& aOriginAttributes, uint32_t aFlags,
|
||||
uintptr_t aListenerAddr, nsACString& aHashKey);
|
||||
const nsACString& aHost, const nsACString& aTrrServer, int32_t aPort,
|
||||
uint16_t aType, const OriginAttributes& aOriginAttributes,
|
||||
uint32_t aFlags, uintptr_t aListenerAddr, nsACString& aHashKey);
|
||||
nsresult AsyncResolveInternal(const nsACString& hostname, uint16_t type,
|
||||
uint32_t flags, nsIDNSResolverInfo* aResolver,
|
||||
uint32_t flags, nsIDNSAdditionalInfo* aInfo,
|
||||
nsIDNSListener* listener,
|
||||
nsIEventTarget* target_,
|
||||
const OriginAttributes& aOriginAttributes,
|
||||
nsICancelable** result);
|
||||
nsresult CancelAsyncResolveInternal(
|
||||
const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
|
||||
nsIDNSResolverInfo* aResolver, nsIDNSListener* aListener,
|
||||
nsresult aReason, const OriginAttributes& aOriginAttributes);
|
||||
nsIDNSAdditionalInfo* aInfo, nsIDNSListener* aListener, nsresult aReason,
|
||||
const OriginAttributes& aOriginAttributes);
|
||||
|
||||
bool mODoHActivated = false;
|
||||
|
||||
|
|
|
@ -2,15 +2,21 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "DNSResolverInfo.h"
|
||||
#include "DNSAdditionalInfo.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
NS_IMPL_ISUPPORTS(DNSResolverInfo, nsIDNSResolverInfo)
|
||||
NS_IMPL_ISUPPORTS(DNSAdditionalInfo, nsIDNSAdditionalInfo)
|
||||
|
||||
NS_IMETHODIMP
|
||||
DNSResolverInfo::GetURL(nsACString& aURL) {
|
||||
DNSAdditionalInfo::GetPort(int32_t* aPort) {
|
||||
*aPort = mPort;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DNSAdditionalInfo::GetResolverURL(nsACString& aURL) {
|
||||
aURL = mURL;
|
||||
return NS_OK;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_net_DNSAdditionalInfo_h__
|
||||
#define mozilla_net_DNSAdditionalInfo_h__
|
||||
|
||||
#include "nsIDNSAdditionalInfo.h"
|
||||
#include "nsString.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
class DNSAdditionalInfo : public nsIDNSAdditionalInfo {
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_NSIDNSADDITIONALINFO
|
||||
public:
|
||||
explicit DNSAdditionalInfo(const nsACString& aURL, int32_t aPort)
|
||||
: mURL(aURL), mPort(aPort){};
|
||||
static nsCString URL(nsIDNSAdditionalInfo* aInfo) {
|
||||
nsCString url;
|
||||
if (aInfo) {
|
||||
MOZ_ALWAYS_SUCCEEDS(aInfo->GetResolverURL(url));
|
||||
}
|
||||
return url;
|
||||
}
|
||||
static int32_t Port(nsIDNSAdditionalInfo* aInfo) {
|
||||
int32_t port = -1;
|
||||
if (aInfo) {
|
||||
MOZ_ALWAYS_SUCCEEDS(aInfo->GetPort(&port));
|
||||
}
|
||||
return port;
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~DNSAdditionalInfo() = default;
|
||||
nsCString mURL;
|
||||
int32_t mPort;
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_net_DNSAdditionalInfo_h__
|
|
@ -33,7 +33,7 @@ class DNSRequestBase : public nsISupports {
|
|||
|
||||
virtual void OnRecvCancelDNSRequest(const nsCString& hostName,
|
||||
const nsCString& trrServer,
|
||||
const uint16_t& type,
|
||||
const int32_t& port, const uint16_t& type,
|
||||
const OriginAttributes& originAttributes,
|
||||
const uint32_t& flags,
|
||||
const nsresult& reason) = 0;
|
||||
|
@ -58,13 +58,14 @@ class DNSRequestSender final : public DNSRequestBase, public nsICancelable {
|
|||
NS_DECL_NSICANCELABLE
|
||||
|
||||
DNSRequestSender(const nsACString& aHost, const nsACString& aTrrServer,
|
||||
const uint16_t& aType,
|
||||
int32_t aPort, const uint16_t& aType,
|
||||
const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags, nsIDNSListener* aListener,
|
||||
nsIEventTarget* target);
|
||||
|
||||
void OnRecvCancelDNSRequest(const nsCString& hostName,
|
||||
const nsCString& trrServer, const uint16_t& type,
|
||||
const nsCString& trrServer, const int32_t& port,
|
||||
const uint16_t& type,
|
||||
const OriginAttributes& originAttributes,
|
||||
const uint32_t& flags,
|
||||
const nsresult& reason) override;
|
||||
|
@ -88,6 +89,7 @@ class DNSRequestSender final : public DNSRequestBase, public nsICancelable {
|
|||
nsresult mResultStatus = NS_OK;
|
||||
nsCString mHost;
|
||||
nsCString mTrrServer;
|
||||
int32_t mPort;
|
||||
uint16_t mType = 0;
|
||||
const OriginAttributes mOriginAttributes;
|
||||
uint16_t mFlags = 0;
|
||||
|
@ -103,11 +105,12 @@ class DNSRequestHandler final : public DNSRequestBase, public nsIDNSListener {
|
|||
DNSRequestHandler() = default;
|
||||
|
||||
void DoAsyncResolve(const nsACString& hostname, const nsACString& trrServer,
|
||||
uint16_t type, const OriginAttributes& originAttributes,
|
||||
uint32_t flags);
|
||||
int32_t port, uint16_t type,
|
||||
const OriginAttributes& originAttributes, uint32_t flags);
|
||||
|
||||
void OnRecvCancelDNSRequest(const nsCString& hostName,
|
||||
const nsCString& trrServer, const uint16_t& type,
|
||||
const nsCString& trrServer, const int32_t& port,
|
||||
const uint16_t& type,
|
||||
const OriginAttributes& originAttributes,
|
||||
const uint32_t& flags,
|
||||
const nsresult& reason) override;
|
||||
|
|
|
@ -356,7 +356,7 @@ ChildDNSByTypeRecord::GetTtl(uint32_t* aResult) {
|
|||
NS_IMPL_ISUPPORTS(DNSRequestSender, nsICancelable)
|
||||
|
||||
DNSRequestSender::DNSRequestSender(
|
||||
const nsACString& aHost, const nsACString& aTrrServer,
|
||||
const nsACString& aHost, const nsACString& aTrrServer, int32_t aPort,
|
||||
const uint16_t& aType, const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags, nsIDNSListener* aListener, nsIEventTarget* target)
|
||||
: mListener(aListener),
|
||||
|
@ -364,14 +364,15 @@ DNSRequestSender::DNSRequestSender(
|
|||
mResultStatus(NS_OK),
|
||||
mHost(aHost),
|
||||
mTrrServer(aTrrServer),
|
||||
mPort(aPort),
|
||||
mType(aType),
|
||||
mOriginAttributes(aOriginAttributes),
|
||||
mFlags(aFlags) {}
|
||||
|
||||
void DNSRequestSender::OnRecvCancelDNSRequest(
|
||||
const nsCString& hostName, const nsCString& trrServer, const uint16_t& type,
|
||||
const OriginAttributes& originAttributes, const uint32_t& flags,
|
||||
const nsresult& reason) {}
|
||||
const nsCString& hostName, const nsCString& trrServer, const int32_t& port,
|
||||
const uint16_t& type, const OriginAttributes& originAttributes,
|
||||
const uint32_t& flags, const nsresult& reason) {}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DNSRequestSender::Cancel(nsresult reason) {
|
||||
|
@ -383,18 +384,19 @@ DNSRequestSender::Cancel(nsresult reason) {
|
|||
// We can only do IPDL on the main thread
|
||||
nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction(
|
||||
"net::CancelDNSRequestEvent",
|
||||
[actor(mIPCActor), host(mHost), trrServer(mTrrServer), type(mType),
|
||||
originAttributes(mOriginAttributes), flags(mFlags), reason]() {
|
||||
[actor(mIPCActor), host(mHost), trrServer(mTrrServer), port(mPort),
|
||||
type(mType), originAttributes(mOriginAttributes), flags(mFlags),
|
||||
reason]() {
|
||||
if (!actor->CanSend()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (DNSRequestChild* child = actor->AsDNSRequestChild()) {
|
||||
Unused << child->SendCancelDNSRequest(
|
||||
host, trrServer, type, originAttributes, flags, reason);
|
||||
host, trrServer, port, type, originAttributes, flags, reason);
|
||||
} else if (DNSRequestParent* parent = actor->AsDNSRequestParent()) {
|
||||
Unused << parent->SendCancelDNSRequest(
|
||||
host, trrServer, type, originAttributes, flags, reason);
|
||||
host, trrServer, port, type, originAttributes, flags, reason);
|
||||
}
|
||||
});
|
||||
SchedulerGroup::Dispatch(TaskCategory::Other, runnable.forget());
|
||||
|
@ -421,8 +423,8 @@ void DNSRequestSender::StartRequest() {
|
|||
}
|
||||
|
||||
// Send request to Parent process.
|
||||
gNeckoChild->SendPDNSRequestConstructor(child, mHost, mTrrServer, mType,
|
||||
mOriginAttributes, mFlags);
|
||||
gNeckoChild->SendPDNSRequestConstructor(child, mHost, mTrrServer, mPort,
|
||||
mType, mOriginAttributes, mFlags);
|
||||
} else if (XRE_IsSocketProcess()) {
|
||||
// DNS resolution is done in the parent process. Send a DNS request to
|
||||
// parent process.
|
||||
|
@ -435,7 +437,7 @@ void DNSRequestSender::StartRequest() {
|
|||
}
|
||||
|
||||
socketProcessChild->SendPDNSRequestConstructor(
|
||||
child, mHost, mTrrServer, mType, mOriginAttributes, mFlags);
|
||||
child, mHost, mTrrServer, mPort, mType, mOriginAttributes, mFlags);
|
||||
} else {
|
||||
MOZ_ASSERT(false, "Wrong process");
|
||||
return;
|
||||
|
@ -449,8 +451,8 @@ void DNSRequestSender::StartRequest() {
|
|||
RefPtr<DNSRequestSender> self = this;
|
||||
auto task = [requestParent, self]() {
|
||||
Unused << SocketProcessParent::GetSingleton()->SendPDNSRequestConstructor(
|
||||
requestParent, self->mHost, self->mTrrServer, self->mType,
|
||||
self->mOriginAttributes, self->mFlags);
|
||||
requestParent, self->mHost, self->mTrrServer, self->mPort,
|
||||
self->mType, self->mOriginAttributes, self->mFlags);
|
||||
};
|
||||
if (!gIOService->SocketProcessReady()) {
|
||||
gIOService->CallOrWaitForSocketProcess(std::move(task));
|
||||
|
@ -535,10 +537,10 @@ DNSRequestChild::DNSRequestChild(DNSRequestBase* aRequest)
|
|||
}
|
||||
|
||||
mozilla::ipc::IPCResult DNSRequestChild::RecvCancelDNSRequest(
|
||||
const nsCString& hostName, const nsCString& trrServer, const uint16_t& type,
|
||||
const OriginAttributes& originAttributes, const uint32_t& flags,
|
||||
const nsresult& reason) {
|
||||
mDNSRequest->OnRecvCancelDNSRequest(hostName, trrServer, type,
|
||||
const nsCString& hostName, const nsCString& trrServer, const int32_t& port,
|
||||
const uint16_t& type, const OriginAttributes& originAttributes,
|
||||
const uint32_t& flags, const nsresult& reason) {
|
||||
mDNSRequest->OnRecvCancelDNSRequest(hostName, trrServer, port, type,
|
||||
originAttributes, flags, reason);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
|
|
@ -29,8 +29,9 @@ class DNSRequestChild final : public DNSRequestActor, public PDNSRequestChild {
|
|||
|
||||
mozilla::ipc::IPCResult RecvCancelDNSRequest(
|
||||
const nsCString& hostName, const nsCString& trrServer,
|
||||
const uint16_t& type, const OriginAttributes& originAttributes,
|
||||
const uint32_t& flags, const nsresult& reason);
|
||||
const int32_t& port, const uint16_t& type,
|
||||
const OriginAttributes& originAttributes, const uint32_t& flags,
|
||||
const nsresult& reason);
|
||||
mozilla::ipc::IPCResult RecvLookupCompleted(const DNSRequestResponse& reply);
|
||||
virtual void ActorDestroy(ActorDestroyReason why) override;
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "nsIDNSRecord.h"
|
||||
#include "nsHostResolver.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "DNSResolverInfo.h"
|
||||
#include "DNSAdditionalInfo.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
||||
using namespace mozilla::ipc;
|
||||
|
@ -38,7 +38,7 @@ static void SendLookupCompletedHelper(DNSRequestActor* aActor,
|
|||
|
||||
void DNSRequestHandler::DoAsyncResolve(const nsACString& hostname,
|
||||
const nsACString& trrServer,
|
||||
uint16_t type,
|
||||
int32_t port, uint16_t type,
|
||||
const OriginAttributes& originAttributes,
|
||||
uint32_t flags) {
|
||||
nsresult rv;
|
||||
|
@ -47,12 +47,12 @@ void DNSRequestHandler::DoAsyncResolve(const nsACString& hostname,
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIEventTarget> main = GetMainThreadEventTarget();
|
||||
nsCOMPtr<nsICancelable> unused;
|
||||
RefPtr<DNSResolverInfo> res;
|
||||
if (!trrServer.IsEmpty()) {
|
||||
res = new DNSResolverInfo(trrServer);
|
||||
RefPtr<DNSAdditionalInfo> info;
|
||||
if (!trrServer.IsEmpty() || port != -1) {
|
||||
info = new DNSAdditionalInfo(trrServer, port);
|
||||
}
|
||||
rv = dns->AsyncResolveNative(
|
||||
hostname, static_cast<nsIDNSService::ResolveType>(type), flags, res,
|
||||
hostname, static_cast<nsIDNSService::ResolveType>(type), flags, info,
|
||||
this, main, originAttributes, getter_AddRefs(unused));
|
||||
}
|
||||
|
||||
|
@ -62,18 +62,18 @@ void DNSRequestHandler::DoAsyncResolve(const nsACString& hostname,
|
|||
}
|
||||
|
||||
void DNSRequestHandler::OnRecvCancelDNSRequest(
|
||||
const nsCString& hostName, const nsCString& aTrrServer,
|
||||
const nsCString& hostName, const nsCString& aTrrServer, const int32_t& port,
|
||||
const uint16_t& type, const OriginAttributes& originAttributes,
|
||||
const uint32_t& flags, const nsresult& reason) {
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDNSService> dns = do_GetService(NS_DNSSERVICE_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
RefPtr<DNSResolverInfo> res;
|
||||
if (!aTrrServer.IsEmpty()) {
|
||||
res = new DNSResolverInfo(aTrrServer);
|
||||
RefPtr<DNSAdditionalInfo> info;
|
||||
if (!aTrrServer.IsEmpty() || port != -1) {
|
||||
info = new DNSAdditionalInfo(aTrrServer, port);
|
||||
}
|
||||
rv = dns->CancelAsyncResolveNative(
|
||||
hostName, static_cast<nsIDNSService::ResolveType>(type), flags, res,
|
||||
hostName, static_cast<nsIDNSService::ResolveType>(type), flags, info,
|
||||
this, reason, originAttributes);
|
||||
}
|
||||
}
|
||||
|
@ -157,10 +157,10 @@ DNSRequestParent::DNSRequestParent(DNSRequestBase* aRequest)
|
|||
}
|
||||
|
||||
mozilla::ipc::IPCResult DNSRequestParent::RecvCancelDNSRequest(
|
||||
const nsCString& hostName, const nsCString& trrServer, const uint16_t& type,
|
||||
const OriginAttributes& originAttributes, const uint32_t& flags,
|
||||
const nsresult& reason) {
|
||||
mDNSRequest->OnRecvCancelDNSRequest(hostName, trrServer, type,
|
||||
const nsCString& hostName, const nsCString& trrServer, const int32_t& port,
|
||||
const uint16_t& type, const OriginAttributes& originAttributes,
|
||||
const uint32_t& flags, const nsresult& reason) {
|
||||
mDNSRequest->OnRecvCancelDNSRequest(hostName, trrServer, port, type,
|
||||
originAttributes, flags, reason);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
|
|
@ -32,8 +32,9 @@ class DNSRequestParent : public DNSRequestActor, public PDNSRequestParent {
|
|||
// needed if the request is to be canceled.
|
||||
mozilla::ipc::IPCResult RecvCancelDNSRequest(
|
||||
const nsCString& hostName, const nsCString& trrServer,
|
||||
const uint16_t& type, const OriginAttributes& originAttributes,
|
||||
const uint32_t& flags, const nsresult& reason);
|
||||
const int32_t& port, const uint16_t& type,
|
||||
const OriginAttributes& originAttributes, const uint32_t& flags,
|
||||
const nsresult& reason);
|
||||
mozilla::ipc::IPCResult RecvLookupCompleted(const DNSRequestResponse& reply);
|
||||
void ActorDestroy(ActorDestroyReason) override;
|
||||
};
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_net_DNSResolverInfo_h__
|
||||
#define mozilla_net_DNSResolverInfo_h__
|
||||
|
||||
#include "nsIDNSResolverInfo.h"
|
||||
#include "nsString.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
class DNSResolverInfo : public nsIDNSResolverInfo {
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_NSIDNSRESOLVERINFO
|
||||
public:
|
||||
explicit DNSResolverInfo(const nsACString& aURL) : mURL(aURL){};
|
||||
static nsCString URL(nsIDNSResolverInfo* aResolver) {
|
||||
nsCString url;
|
||||
if (aResolver) {
|
||||
MOZ_ALWAYS_SUCCEEDS(aResolver->GetURL(url));
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~DNSResolverInfo() = default;
|
||||
nsCString mURL;
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_net_DNSResolverInfo_h__
|
|
@ -26,7 +26,7 @@ both:
|
|||
|
||||
// Pass args here rather than storing them in the parent; they are only
|
||||
// needed if the request is to be canceled.
|
||||
async CancelDNSRequest(nsCString hostName, nsCString trrServer,
|
||||
async CancelDNSRequest(nsCString hostName, nsCString trrServer, int32_t port,
|
||||
uint16_t type, OriginAttributes originAttributes,
|
||||
uint32_t flags, nsresult reason);
|
||||
async __delete__();
|
||||
|
|
|
@ -10,10 +10,10 @@ with Files("**"):
|
|||
DIRS += ["tests"]
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
"nsIDNSAdditionalInfo.idl",
|
||||
"nsIDNSByTypeRecord.idl",
|
||||
"nsIDNSListener.idl",
|
||||
"nsIDNSRecord.idl",
|
||||
"nsIDNSResolverInfo.idl",
|
||||
"nsIDNSService.idl",
|
||||
"nsIEffectiveTLDService.idl",
|
||||
"nsIIDNService.idl",
|
||||
|
@ -60,11 +60,11 @@ SOURCES += [
|
|||
UNIFIED_SOURCES += [
|
||||
"ChildDNSService.cpp",
|
||||
"DNS.cpp",
|
||||
"DNSAdditionalInfo.cpp",
|
||||
"DNSListenerProxy.cpp",
|
||||
"DNSPacket.cpp",
|
||||
"DNSRequestChild.cpp",
|
||||
"DNSRequestParent.cpp",
|
||||
"DNSResolverInfo.cpp",
|
||||
"DNSServiceBase.cpp",
|
||||
"DNSUtils.cpp",
|
||||
"HostRecordQueue.cpp",
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "nsQueryObject.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsINetworkLinkService.h"
|
||||
#include "DNSResolverInfo.h"
|
||||
#include "DNSAdditionalInfo.h"
|
||||
#include "TRRService.h"
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
|
@ -977,7 +977,7 @@ nsresult nsDNSService::PreprocessHostname(bool aLocalDomain,
|
|||
|
||||
nsresult nsDNSService::AsyncResolveInternal(
|
||||
const nsACString& aHostname, uint16_t type, uint32_t flags,
|
||||
nsIDNSResolverInfo* aResolver, nsIDNSListener* aListener,
|
||||
nsIDNSAdditionalInfo* aInfo, nsIDNSListener* aListener,
|
||||
nsIEventTarget* target_, const OriginAttributes& aOriginAttributes,
|
||||
nsICancelable** result) {
|
||||
// grab reference to global host resolver and IDN service. beware
|
||||
|
@ -1045,13 +1045,13 @@ nsresult nsDNSService::AsyncResolveInternal(
|
|||
|
||||
MOZ_ASSERT(listener);
|
||||
RefPtr<nsDNSAsyncRequest> req =
|
||||
new nsDNSAsyncRequest(res, hostname, DNSResolverInfo::URL(aResolver),
|
||||
type, aOriginAttributes, listener, flags, af);
|
||||
new nsDNSAsyncRequest(res, hostname, DNSAdditionalInfo::URL(aInfo), type,
|
||||
aOriginAttributes, listener, flags, af);
|
||||
if (!req) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
rv = res->ResolveHost(req->mHost, DNSResolverInfo::URL(aResolver), type,
|
||||
rv = res->ResolveHost(req->mHost, DNSAdditionalInfo::URL(aInfo), type,
|
||||
req->mOriginAttributes, flags, af, req);
|
||||
req.forget(result);
|
||||
return rv;
|
||||
|
@ -1059,7 +1059,7 @@ nsresult nsDNSService::AsyncResolveInternal(
|
|||
|
||||
nsresult nsDNSService::CancelAsyncResolveInternal(
|
||||
const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
|
||||
nsIDNSResolverInfo* aResolver, nsIDNSListener* aListener, nsresult aReason,
|
||||
nsIDNSAdditionalInfo* aInfo, nsIDNSListener* aListener, nsresult aReason,
|
||||
const OriginAttributes& aOriginAttributes) {
|
||||
// grab reference to global host resolver and IDN service. beware
|
||||
// simultaneous shutdown!!
|
||||
|
@ -1090,7 +1090,7 @@ nsresult nsDNSService::CancelAsyncResolveInternal(
|
|||
uint16_t af =
|
||||
(aType != RESOLVE_TYPE_DEFAULT) ? 0 : GetAFForLookup(hostname, aFlags);
|
||||
|
||||
res->CancelAsyncRequest(hostname, DNSResolverInfo::URL(aResolver), aType,
|
||||
res->CancelAsyncRequest(hostname, DNSAdditionalInfo::URL(aInfo), aType,
|
||||
aOriginAttributes, aFlags, af, aListener, aReason);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1098,7 +1098,7 @@ nsresult nsDNSService::CancelAsyncResolveInternal(
|
|||
NS_IMETHODIMP
|
||||
nsDNSService::AsyncResolve(const nsACString& aHostname,
|
||||
nsIDNSService::ResolveType aType, uint32_t flags,
|
||||
nsIDNSResolverInfo* aResolver,
|
||||
nsIDNSAdditionalInfo* aInfo,
|
||||
nsIDNSListener* listener, nsIEventTarget* target_,
|
||||
JS::HandleValue aOriginAttributes, JSContext* aCx,
|
||||
uint8_t aArgc, nsICancelable** result) {
|
||||
|
@ -1110,34 +1110,34 @@ nsDNSService::AsyncResolve(const nsACString& aHostname,
|
|||
}
|
||||
}
|
||||
|
||||
return AsyncResolveInternal(aHostname, aType, flags, aResolver, listener,
|
||||
target_, attrs, result);
|
||||
return AsyncResolveInternal(aHostname, aType, flags, aInfo, listener, target_,
|
||||
attrs, result);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDNSService::AsyncResolveNative(const nsACString& aHostname,
|
||||
nsIDNSService::ResolveType aType,
|
||||
uint32_t flags, nsIDNSResolverInfo* aResolver,
|
||||
uint32_t flags, nsIDNSAdditionalInfo* aInfo,
|
||||
nsIDNSListener* aListener,
|
||||
nsIEventTarget* target_,
|
||||
const OriginAttributes& aOriginAttributes,
|
||||
nsICancelable** result) {
|
||||
return AsyncResolveInternal(aHostname, aType, flags, aResolver, aListener,
|
||||
return AsyncResolveInternal(aHostname, aType, flags, aInfo, aListener,
|
||||
target_, aOriginAttributes, result);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDNSService::NewTRRResolverInfo(const nsACString& aTrrURL,
|
||||
nsIDNSResolverInfo** aResolver) {
|
||||
RefPtr<DNSResolverInfo> res = new DNSResolverInfo(aTrrURL);
|
||||
res.forget(aResolver);
|
||||
nsDNSService::NewAdditionalInfo(const nsACString& aTrrURL, int32_t aPort,
|
||||
nsIDNSAdditionalInfo** aInfo) {
|
||||
RefPtr<DNSAdditionalInfo> res = new DNSAdditionalInfo(aTrrURL, aPort);
|
||||
res.forget(aInfo);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDNSService::CancelAsyncResolve(const nsACString& aHostname,
|
||||
nsIDNSService::ResolveType aType,
|
||||
uint32_t aFlags, nsIDNSResolverInfo* aResolver,
|
||||
uint32_t aFlags, nsIDNSAdditionalInfo* aInfo,
|
||||
nsIDNSListener* aListener, nsresult aReason,
|
||||
JS::HandleValue aOriginAttributes,
|
||||
JSContext* aCx, uint8_t aArgc) {
|
||||
|
@ -1149,17 +1149,17 @@ nsDNSService::CancelAsyncResolve(const nsACString& aHostname,
|
|||
}
|
||||
}
|
||||
|
||||
return CancelAsyncResolveInternal(aHostname, aType, aFlags, aResolver,
|
||||
aListener, aReason, attrs);
|
||||
return CancelAsyncResolveInternal(aHostname, aType, aFlags, aInfo, aListener,
|
||||
aReason, attrs);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDNSService::CancelAsyncResolveNative(
|
||||
const nsACString& aHostname, nsIDNSService::ResolveType aType,
|
||||
uint32_t aFlags, nsIDNSResolverInfo* aResolver, nsIDNSListener* aListener,
|
||||
uint32_t aFlags, nsIDNSAdditionalInfo* aInfo, nsIDNSListener* aListener,
|
||||
nsresult aReason, const OriginAttributes& aOriginAttributes) {
|
||||
return CancelAsyncResolveInternal(aHostname, aType, aFlags, aResolver,
|
||||
aListener, aReason, aOriginAttributes);
|
||||
return CancelAsyncResolveInternal(aHostname, aType, aFlags, aInfo, aListener,
|
||||
aReason, aOriginAttributes);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -84,15 +84,15 @@ class nsDNSService final : public mozilla::net::DNSServiceBase,
|
|||
|
||||
nsresult AsyncResolveInternal(
|
||||
const nsACString& aHostname, uint16_t type, uint32_t flags,
|
||||
nsIDNSResolverInfo* aResolver, nsIDNSListener* aListener,
|
||||
nsIDNSAdditionalInfo* aInfo, nsIDNSListener* aListener,
|
||||
nsIEventTarget* target_,
|
||||
const mozilla::OriginAttributes& aOriginAttributes,
|
||||
nsICancelable** result);
|
||||
|
||||
nsresult CancelAsyncResolveInternal(
|
||||
const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
|
||||
nsIDNSResolverInfo* aResolver, nsIDNSListener* aListener,
|
||||
nsresult aReason, const mozilla::OriginAttributes& aOriginAttributes);
|
||||
nsIDNSAdditionalInfo* aInfo, nsIDNSListener* aListener, nsresult aReason,
|
||||
const mozilla::OriginAttributes& aOriginAttributes);
|
||||
|
||||
nsresult ResolveInternal(const nsACString& aHostname, uint32_t flags,
|
||||
const mozilla::OriginAttributes& aOriginAttributes,
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(74db2955-6298-4d82-a3b9-7f9e8ba9e854)]
|
||||
interface nsIDNSResolverInfo : nsISupports
|
||||
interface nsIDNSAdditionalInfo : nsISupports
|
||||
{
|
||||
readonly attribute ACString URL;
|
||||
readonly attribute int32_t port;
|
||||
readonly attribute ACString resolverURL;
|
||||
};
|
|
@ -13,7 +13,7 @@ interface nsICancelable;
|
|||
interface nsIEventTarget;
|
||||
interface nsIDNSRecord;
|
||||
interface nsIDNSListener;
|
||||
interface nsIDNSResolverInfo;
|
||||
interface nsIDNSAdditionalInfo;
|
||||
|
||||
%{C++
|
||||
#include "nsTArrayForwardDeclare.h"
|
||||
|
@ -59,9 +59,12 @@ interface nsIDNSService : nsISupports
|
|||
* one of RESOLVE_TYPE_*.
|
||||
* @param aFlags
|
||||
* a bitwise OR of the RESOLVE_ prefixed constants defined below.
|
||||
* @param aResolver
|
||||
* a resolverInfo object that holds information about the resolver
|
||||
* to be used such as TRR URL. If null we use the default configuration.
|
||||
* @param aInfo
|
||||
* a AdditionalInfo object that holds information about:
|
||||
* - the resolver to be used such as TRR URL
|
||||
* - the port number that could be used to construct a QNAME
|
||||
* for HTTPS RR
|
||||
* If null we use the default configuration.
|
||||
* @param aListener
|
||||
* the listener to be notified when the result is available.
|
||||
* @param aListenerTarget
|
||||
|
@ -81,7 +84,7 @@ interface nsIDNSService : nsISupports
|
|||
nsICancelable asyncResolve(in AUTF8String aHostName,
|
||||
in nsIDNSService_ResolveType aType,
|
||||
in unsigned long aFlags,
|
||||
in nsIDNSResolverInfo aResolver,
|
||||
in nsIDNSAdditionalInfo aInfo,
|
||||
in nsIDNSListener aListener,
|
||||
in nsIEventTarget aListenerTarget,
|
||||
[optional] in jsval aOriginAttributes);
|
||||
|
@ -90,16 +93,17 @@ interface nsIDNSService : nsISupports
|
|||
nsresult asyncResolveNative(in AUTF8String aHostName,
|
||||
in nsIDNSService_ResolveType aType,
|
||||
in unsigned long aFlags,
|
||||
in nsIDNSResolverInfo aResolver,
|
||||
in nsIDNSAdditionalInfo aInfo,
|
||||
in nsIDNSListener aListener,
|
||||
in nsIEventTarget aListenerTarget,
|
||||
in OriginAttributes aOriginAttributes,
|
||||
out nsICancelable aResult);
|
||||
|
||||
/**
|
||||
* Returns a new resolverInfo object containing the URL we pass to it.
|
||||
* Returns a new nsIDNSAdditionalInfo object containing the URL we pass to it.
|
||||
*/
|
||||
nsIDNSResolverInfo newTRRResolverInfo(in AUTF8String aTrrURL);
|
||||
nsIDNSAdditionalInfo newAdditionalInfo(in AUTF8String aTrrURL,
|
||||
in int32_t aPort);
|
||||
|
||||
/**
|
||||
* Attempts to cancel a previously requested async DNS lookup
|
||||
|
@ -110,9 +114,12 @@ interface nsIDNSService : nsISupports
|
|||
* one of RESOLVE_TYPE_*.
|
||||
* @param aFlags
|
||||
* a bitwise OR of the RESOLVE_ prefixed constants defined below.
|
||||
* @param aResolver
|
||||
* a resolverInfo object that holds information about the resolver
|
||||
* to be used such as TRR URL. If null we use the default configuration.
|
||||
* @param aInfo
|
||||
* a AdditionalInfo object that holds information about:
|
||||
* - the resolver to be used such as TRR URL
|
||||
* - the port number that could be used to construct a QNAME
|
||||
* for HTTPS RR
|
||||
* If null we use the default configuration.
|
||||
* @param aListener
|
||||
* the original listener which was to be notified about the host lookup
|
||||
* result - used to match request information to requestor.
|
||||
|
@ -126,7 +133,7 @@ interface nsIDNSService : nsISupports
|
|||
void cancelAsyncResolve(in AUTF8String aHostName,
|
||||
in nsIDNSService_ResolveType aType,
|
||||
in unsigned long aFlags,
|
||||
in nsIDNSResolverInfo aResolver,
|
||||
in nsIDNSAdditionalInfo aResolver,
|
||||
in nsIDNSListener aListener,
|
||||
in nsresult aReason,
|
||||
[optional] in jsval aOriginAttributes);
|
||||
|
@ -135,7 +142,7 @@ interface nsIDNSService : nsISupports
|
|||
nsresult cancelAsyncResolveNative(in AUTF8String aHostName,
|
||||
in nsIDNSService_ResolveType aType,
|
||||
in unsigned long aFlags,
|
||||
in nsIDNSResolverInfo aResolver,
|
||||
in nsIDNSAdditionalInfo aResolver,
|
||||
in nsIDNSListener aListener,
|
||||
in nsresult aReason,
|
||||
in OriginAttributes aOriginAttributes);
|
||||
|
|
|
@ -506,8 +506,9 @@ bool NeckoParent::DeallocPUDPSocketParent(PUDPSocketParent* actor) {
|
|||
}
|
||||
|
||||
already_AddRefed<PDNSRequestParent> NeckoParent::AllocPDNSRequestParent(
|
||||
const nsCString& aHost, const nsCString& aTrrServer, const uint16_t& aType,
|
||||
const OriginAttributes& aOriginAttributes, const uint32_t& aFlags) {
|
||||
const nsCString& aHost, const nsCString& aTrrServer, const int32_t& aPort,
|
||||
const uint16_t& aType, const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags) {
|
||||
RefPtr<DNSRequestHandler> handler = new DNSRequestHandler();
|
||||
RefPtr<DNSRequestParent> actor = new DNSRequestParent(handler);
|
||||
return actor.forget();
|
||||
|
@ -515,12 +516,13 @@ already_AddRefed<PDNSRequestParent> NeckoParent::AllocPDNSRequestParent(
|
|||
|
||||
mozilla::ipc::IPCResult NeckoParent::RecvPDNSRequestConstructor(
|
||||
PDNSRequestParent* aActor, const nsCString& aHost,
|
||||
const nsCString& aTrrServer, const uint16_t& aType,
|
||||
const nsCString& aTrrServer, const int32_t& aPort, const uint16_t& aType,
|
||||
const OriginAttributes& aOriginAttributes, const uint32_t& aFlags) {
|
||||
RefPtr<DNSRequestParent> actor = static_cast<DNSRequestParent*>(aActor);
|
||||
RefPtr<DNSRequestHandler> handler =
|
||||
actor->GetDNSRequest()->AsDNSRequestHandler();
|
||||
handler->DoAsyncResolve(aHost, aTrrServer, aType, aOriginAttributes, aFlags);
|
||||
handler->DoAsyncResolve(aHost, aTrrServer, aPort, aType, aOriginAttributes,
|
||||
aFlags);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
|
|
|
@ -114,12 +114,12 @@ class NeckoParent : public PNeckoParent {
|
|||
const nsCString& aFilter) override;
|
||||
bool DeallocPUDPSocketParent(PUDPSocketParent*);
|
||||
already_AddRefed<PDNSRequestParent> AllocPDNSRequestParent(
|
||||
const nsCString& aHost, const nsCString& aTrrServer,
|
||||
const nsCString& aHost, const nsCString& aTrrServer, const int32_t& aPort,
|
||||
const uint16_t& aType, const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags);
|
||||
virtual mozilla::ipc::IPCResult RecvPDNSRequestConstructor(
|
||||
PDNSRequestParent* actor, const nsCString& aHost,
|
||||
const nsCString& trrServer, const uint16_t& type,
|
||||
const nsCString& trrServer, const int32_t& aPort, const uint16_t& type,
|
||||
const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& flags) override;
|
||||
mozilla::ipc::IPCResult RecvSpeculativeConnect(nsIURI* aURI,
|
||||
|
|
|
@ -86,8 +86,9 @@ parent:
|
|||
async PTCPServerSocket(uint16_t localPort, uint16_t backlog, bool useArrayBuffers);
|
||||
async PUDPSocket(nsIPrincipal principal, nsCString filter);
|
||||
|
||||
async PDNSRequest(nsCString hostName, nsCString trrServer, uint16_t type,
|
||||
OriginAttributes originAttributes, uint32_t flags);
|
||||
async PDNSRequest(nsCString hostName, nsCString trrServer, int32_t port,
|
||||
uint16_t type, OriginAttributes originAttributes,
|
||||
uint32_t flags);
|
||||
|
||||
async PDocumentChannel(MaybeDiscardedBrowsingContext browsingContext,
|
||||
DocumentChannelCreationArgs args);
|
||||
|
|
|
@ -236,8 +236,9 @@ child:
|
|||
|
||||
both:
|
||||
async PFileDescriptorSet(FileDescriptor fd);
|
||||
async PDNSRequest(nsCString hostName, nsCString trrServer, uint16_t type,
|
||||
OriginAttributes originAttributes, uint32_t flags);
|
||||
async PDNSRequest(nsCString hostName, nsCString trrServer, int32_t port,
|
||||
uint16_t type, OriginAttributes originAttributes,
|
||||
uint32_t flags);
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
|
|
|
@ -472,8 +472,9 @@ SocketProcessChild::AllocPAltSvcTransactionChild(
|
|||
}
|
||||
|
||||
already_AddRefed<PDNSRequestChild> SocketProcessChild::AllocPDNSRequestChild(
|
||||
const nsCString& aHost, const nsCString& aTrrServer, const uint16_t& aType,
|
||||
const OriginAttributes& aOriginAttributes, const uint32_t& aFlags) {
|
||||
const nsCString& aHost, const nsCString& aTrrServer, const int32_t& aPort,
|
||||
const uint16_t& aType, const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags) {
|
||||
RefPtr<DNSRequestHandler> handler = new DNSRequestHandler();
|
||||
RefPtr<DNSRequestChild> actor = new DNSRequestChild(handler);
|
||||
return actor.forget();
|
||||
|
@ -481,12 +482,13 @@ already_AddRefed<PDNSRequestChild> SocketProcessChild::AllocPDNSRequestChild(
|
|||
|
||||
mozilla::ipc::IPCResult SocketProcessChild::RecvPDNSRequestConstructor(
|
||||
PDNSRequestChild* aActor, const nsCString& aHost,
|
||||
const nsCString& aTrrServer, const uint16_t& aType,
|
||||
const nsCString& aTrrServer, const int32_t& aPort, const uint16_t& aType,
|
||||
const OriginAttributes& aOriginAttributes, const uint32_t& aFlags) {
|
||||
RefPtr<DNSRequestChild> actor = static_cast<DNSRequestChild*>(aActor);
|
||||
RefPtr<DNSRequestHandler> handler =
|
||||
actor->GetDNSRequest()->AsDNSRequestHandler();
|
||||
handler->DoAsyncResolve(aHost, aTrrServer, aType, aOriginAttributes, aFlags);
|
||||
handler->DoAsyncResolve(aHost, aTrrServer, aPort, aType, aOriginAttributes,
|
||||
aFlags);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
|
|
|
@ -104,12 +104,12 @@ class SocketProcessChild final
|
|||
bool IsShuttingDown() { return mShuttingDown; }
|
||||
|
||||
already_AddRefed<PDNSRequestChild> AllocPDNSRequestChild(
|
||||
const nsCString& aHost, const nsCString& aTrrServer,
|
||||
const nsCString& aHost, const nsCString& aTrrServer, const int32_t& aPort,
|
||||
const uint16_t& aType, const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags);
|
||||
mozilla::ipc::IPCResult RecvPDNSRequestConstructor(
|
||||
PDNSRequestChild* aActor, const nsCString& aHost,
|
||||
const nsCString& aTrrServer, const uint16_t& aType,
|
||||
const nsCString& aTrrServer, const int32_t& aPort, const uint16_t& aType,
|
||||
const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags) override;
|
||||
|
||||
|
|
|
@ -215,8 +215,9 @@ bool SocketProcessParent::DeallocPWebrtcTCPSocketParent(
|
|||
}
|
||||
|
||||
already_AddRefed<PDNSRequestParent> SocketProcessParent::AllocPDNSRequestParent(
|
||||
const nsCString& aHost, const nsCString& aTrrServer, const uint16_t& aType,
|
||||
const OriginAttributes& aOriginAttributes, const uint32_t& aFlags) {
|
||||
const nsCString& aHost, const nsCString& aTrrServer, const int32_t& port,
|
||||
const uint16_t& aType, const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags) {
|
||||
RefPtr<DNSRequestHandler> handler = new DNSRequestHandler();
|
||||
RefPtr<DNSRequestParent> actor = new DNSRequestParent(handler);
|
||||
return actor.forget();
|
||||
|
@ -224,12 +225,13 @@ already_AddRefed<PDNSRequestParent> SocketProcessParent::AllocPDNSRequestParent(
|
|||
|
||||
mozilla::ipc::IPCResult SocketProcessParent::RecvPDNSRequestConstructor(
|
||||
PDNSRequestParent* aActor, const nsCString& aHost,
|
||||
const nsCString& aTrrServer, const uint16_t& aType,
|
||||
const nsCString& aTrrServer, const int32_t& port, const uint16_t& aType,
|
||||
const OriginAttributes& aOriginAttributes, const uint32_t& aFlags) {
|
||||
RefPtr<DNSRequestParent> actor = static_cast<DNSRequestParent*>(aActor);
|
||||
RefPtr<DNSRequestHandler> handler =
|
||||
actor->GetDNSRequest()->AsDNSRequestHandler();
|
||||
handler->DoAsyncResolve(aHost, aTrrServer, aType, aOriginAttributes, aFlags);
|
||||
handler->DoAsyncResolve(aHost, aTrrServer, port, aType, aOriginAttributes,
|
||||
aFlags);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
|
|
|
@ -55,12 +55,12 @@ class SocketProcessParent final
|
|||
const Maybe<TabId>& aTabId);
|
||||
bool DeallocPWebrtcTCPSocketParent(PWebrtcTCPSocketParent* aActor);
|
||||
already_AddRefed<PDNSRequestParent> AllocPDNSRequestParent(
|
||||
const nsCString& aHost, const nsCString& aTrrServer,
|
||||
const nsCString& aHost, const nsCString& aTrrServer, const int32_t& port,
|
||||
const uint16_t& aType, const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags);
|
||||
virtual mozilla::ipc::IPCResult RecvPDNSRequestConstructor(
|
||||
PDNSRequestParent* actor, const nsCString& aHost,
|
||||
const nsCString& trrServer, const uint16_t& type,
|
||||
const nsCString& trrServer, const int32_t& port, const uint16_t& type,
|
||||
const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& flags) override;
|
||||
|
||||
|
|
|
@ -144,14 +144,14 @@ class TRRDNSListener {
|
|||
);
|
||||
}
|
||||
|
||||
this.resolverInfo =
|
||||
trrServer == "" ? null : gDNS.newTRRResolverInfo(trrServer);
|
||||
this.additionalInfo =
|
||||
trrServer == "" ? null : gDNS.newAdditionalInfo(trrServer, -1);
|
||||
try {
|
||||
this.request = gDNS.asyncResolve(
|
||||
this.name,
|
||||
this.type,
|
||||
this.options.flags || 0,
|
||||
this.resolverInfo,
|
||||
this.additionalInfo,
|
||||
this,
|
||||
currentThread,
|
||||
{} // defaultOriginAttributes
|
||||
|
|
|
@ -73,7 +73,7 @@ this.dns = class extends ExtensionAPI {
|
|||
hostname,
|
||||
Ci.nsIDNSService.RESOLVE_TYPE_DEFAULT,
|
||||
dnsFlags,
|
||||
null, // resolverInfo
|
||||
null, // AdditionalInfo
|
||||
listener,
|
||||
null,
|
||||
{} /* defaultOriginAttributes */
|
||||
|
|
Загрузка…
Ссылка в новой задаче