1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_net_DNSAdditionalInfo_h__
6 #define mozilla_net_DNSAdditionalInfo_h__
8 #include "nsIDNSAdditionalInfo.h"
14 class DNSAdditionalInfo
: public nsIDNSAdditionalInfo
{
15 NS_DECL_THREADSAFE_ISUPPORTS
16 NS_DECL_NSIDNSADDITIONALINFO
18 explicit DNSAdditionalInfo(const nsACString
& aURL
, int32_t aPort
)
19 : mURL(aURL
), mPort(aPort
){};
20 static nsCString
URL(nsIDNSAdditionalInfo
* aInfo
) {
23 MOZ_ALWAYS_SUCCEEDS(aInfo
->GetResolverURL(url
));
27 static int32_t Port(nsIDNSAdditionalInfo
* aInfo
) {
30 MOZ_ALWAYS_SUCCEEDS(aInfo
->GetPort(&port
));
36 virtual ~DNSAdditionalInfo() = default;
42 } // namespace mozilla
44 #endif // mozilla_net_DNSAdditionalInfo_h__