Merge mozilla-central to autoland a=merge

This commit is contained in:
Coroiu Cristina 2019-04-13 15:19:54 +03:00
Родитель d8d0bcab65 8442bbf9c9
Коммит d4f3370b50
35 изменённых файлов: 59 добавлений и 144 удалений

Просмотреть файл

@ -444,7 +444,7 @@ void nsHTMLDocument::TryFallback(int32_t& aCharsetSource,
aEncoding = FallbackEncoding::FromLocale();
}
// Using a prototype document is currently only allowed with browser.xhtml.
// Using a prototype document is only allowed with chrome privilege.
bool ShouldUsePrototypeDocument(nsIChannel* aChannel, nsIDocShell* aDocShell) {
if (!aChannel || !aDocShell ||
!StaticPrefs::dom_prototype_document_cache_enabled()) {
@ -455,9 +455,7 @@ bool ShouldUsePrototypeDocument(nsIChannel* aChannel, nsIDocShell* aDocShell) {
}
nsCOMPtr<nsIURI> originalURI;
aChannel->GetOriginalURI(getter_AddRefs(originalURI));
return IsChromeURI(originalURI) &&
originalURI->GetSpecOrDefault().EqualsLiteral(
BROWSER_CHROME_URL_QUOTED);
return IsChromeURI(originalURI);
}
nsresult nsHTMLDocument::StartDocumentLoad(const char* aCommand,
@ -561,7 +559,7 @@ nsresult nsHTMLDocument::StartDocumentLoad(const char* aCommand,
} else {
mParser->MarkAsNotScriptCreated(aCommand);
}
} else if (ShouldUsePrototypeDocument(aChannel, docShell)) {
} else if (xhtml && ShouldUsePrototypeDocument(aChannel, docShell)) {
loadWithPrototype = true;
nsCOMPtr<nsIURI> originalURI;
aChannel->GetOriginalURI(getter_AddRefs(originalURI));

Просмотреть файл

@ -1034,6 +1034,15 @@ nsresult PrototypeDocumentContentSink::CreateElementFromPrototype(
rv = AddAttributes(aPrototype, result);
if (NS_FAILED(rv)) return rv;
if (xtfNi->Equals(nsGkAtoms::script, kNameSpaceID_XHTML) ||
xtfNi->Equals(nsGkAtoms::script, kNameSpaceID_SVG)) {
nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(result);
MOZ_ASSERT(sele, "Node didn't QI to script.");
// Script loading is handled by the this content sink, so prevent the
// script from loading when it is bound to the document.
sele->PreventExecution();
}
}
result.forget(aResult);

Просмотреть файл

@ -21,10 +21,10 @@
namespace mozilla {
class DOMSVGAnimatedNumberList;
namespace dom {
class DOMSVGAnimatedNumberList;
typedef SVGFEUnstyledElement SVGComponentTransferFunctionElementBase;
class SVGComponentTransferFunctionElement

Просмотреть файл

@ -784,7 +784,7 @@ already_AddRefed<gfx::Path> SVGContentUtils::GetPath(
SVGPathData pathData;
SVGPathDataParser parser(aPathString, &pathData);
if (!parser.Parse()) {
return NULL;
return nullptr;
}
RefPtr<DrawTarget> drawTarget =

Просмотреть файл

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize};
use util;
//TODO: gather real-world statistics on the bin usage in order to assist the decision
// on where to place the size thresholds.
@ -167,10 +166,10 @@ impl ArrayAllocationTracker {
}
// Add the guillotined rects back to the free list.
if !util::rect_is_empty(&new_free_rect_to_right) {
if !new_free_rect_to_right.is_empty() {
self.push(chosen.slice, new_free_rect_to_right);
}
if !util::rect_is_empty(&new_free_rect_to_bottom) {
if !new_free_rect_to_bottom.is_empty() {
self.push(chosen.slice, new_free_rect_to_bottom);
}
}

Просмотреть файл

@ -4,10 +4,9 @@
use api::BorderRadius;
use api::units::*;
use euclid::{Point2D, Rect, Size2D, TypedPoint2D, TypedRect, TypedSize2D, Vector2D};
use euclid::{TypedPoint2D, TypedRect, TypedSize2D, Vector2D};
use euclid::{TypedTransform2D, TypedTransform3D, TypedVector2D, TypedScale};
use malloc_size_of::{MallocShallowSizeOf, MallocSizeOf, MallocSizeOfOps};
use num_traits::Zero;
use plane_split::{Clipper, Polygon};
use std::{i32, f32, fmt, ptr};
use std::borrow::Cow;
@ -416,18 +415,6 @@ impl<U> RectHelpers<U> for TypedRect<f32, U> {
}
}
// Don't use `euclid`'s `is_empty` because that has effectively has an "and" in the conditional
// below instead of an "or".
pub fn rect_is_empty<N: PartialEq + Zero, U>(rect: &TypedRect<N, U>) -> bool {
rect.size.width == Zero::zero() || rect.size.height == Zero::zero()
}
#[allow(dead_code)]
#[inline]
pub fn rect_from_points_f(x0: f32, y0: f32, x1: f32, y1: f32) -> Rect<f32> {
Rect::new(Point2D::new(x0, y0), Size2D::new(x1 - x0, y1 - y0))
}
pub fn lerp(a: f32, b: f32, t: f32) -> f32 {
(b - a) * t + a
}

Просмотреть файл

@ -3677,7 +3677,7 @@ uint32_t SVGTextFrame::GetNumberOfChars(nsIContent* aContent) {
float SVGTextFrame::GetComputedTextLength(nsIContent* aContent) {
UpdateGlyphPositioning();
float cssPxPerDevPx = PresContext()->AppUnitsToFloatCSSPixels(
float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(
PresContext()->AppUnitsPerDevPixel());
nscoord length = 0;

Просмотреть файл

@ -33,7 +33,7 @@ class nsCSSClipPathInstance {
private:
explicit nsCSSClipPathInstance(nsIFrame* aFrame,
const StyleShapeSource aClipPathStyle)
const StyleShapeSource& aClipPathStyle)
: mTargetFrame(aFrame), mClipPathStyle(aClipPathStyle) {}
already_AddRefed<Path> CreateClipPath(DrawTarget* aDrawTarget);

Просмотреть файл

@ -253,7 +253,7 @@ void nsSVGForeignObjectFrame::PaintSVG(gfxContext& aContext,
// SVG paints in CSS px, but normally frames paint in dev pixels. Here we
// multiply a CSS-px-to-dev-pixel factor onto aTransform so our children
// paint correctly.
float cssPxPerDevPx = PresContext()->AppUnitsToFloatCSSPixels(
float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(
PresContext()->AppUnitsPerDevPixel());
gfxMatrix canvasTMForChildren = aTransform;
canvasTMForChildren.PreScale(cssPxPerDevPx, cssPxPerDevPx);

Просмотреть файл

@ -95,7 +95,7 @@ class PreEffectsVisualOverflowCollector : public nsLayoutUtils::BoxCallback {
if (nsSVGIntegrationUtils::UsingOverflowAffectingEffects(aFrame) &&
!aInReflow) {
nsOverflowAreas* preTransformOverflows =
aFrame->GetProperty(aFrame->PreTransformOverflowAreasProperty());
aFrame->GetProperty(nsIFrame::PreTransformOverflowAreasProperty());
MOZ_ASSERT(!preTransformOverflows,
"GetVisualOverflowRect() won't return the pre-effects rect!");

Просмотреть файл

@ -860,7 +860,7 @@ gfxMatrix nsSVGOuterSVGFrame::GetCanvasTM() {
if (!mCanvasTM) {
SVGSVGElement* content = static_cast<SVGSVGElement*>(GetContent());
float devPxPerCSSPx = 1.0f / PresContext()->AppUnitsToFloatCSSPixels(
float devPxPerCSSPx = 1.0f / nsPresContext::AppUnitsToFloatCSSPixels(
PresContext()->AppUnitsPerDevPixel());
gfxMatrix tm = content->PrependLocalTransformsTo(

Просмотреть файл

@ -636,7 +636,7 @@ gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGAnimatedViewBox &aViewBox,
if (!aViewBox.IsExplicitlySet()) {
return gfxMatrix(scaleX, 0.0, 0.0, scaleY, 0.0, 0.0);
}
const SVGViewBox viewBox = aViewBox.GetAnimValue();
const SVGViewBox& viewBox = aViewBox.GetAnimValue();
if (viewBox.height <= 0.0f || viewBox.width <= 0.0f) {
return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular

Просмотреть файл

@ -182,10 +182,6 @@ class FakeSocketTransportProvider : public nsISocketTransport {
MOZ_ASSERT(false);
return NS_OK;
}
NS_IMETHOD ResolvedByTRR(bool *aResolvedByTRR) override {
MOZ_ASSERT(false);
return NS_OK;
}
// nsITransport
NS_IMETHOD OpenInputStream(uint32_t aFlags, uint32_t aSegmentSize,

Просмотреть файл

@ -314,9 +314,4 @@ interface nsISocketTransport : nsITransport
* The value is set after PR_Connect is called.
*/
readonly attribute boolean esniUsed;
/**
* IP address resolved using TRR.
*/
bool resolvedByTRR();
};

Просмотреть файл

@ -708,7 +708,6 @@ nsSocketTransport::nsSocketTransport()
mInputClosed(true),
mOutputClosed(true),
mResolving(false),
mResolvedByTRR(false),
mDNSLookupStatus(NS_OK),
mDNSARequestFinished(0),
mEsniQueried(false),
@ -1804,7 +1803,6 @@ bool nsSocketTransport::RecoverFromError() {
// try next ip address only if past the resolver stage...
if (mState == STATE_CONNECTING && mDNSRecord) {
nsresult rv = mDNSRecord->GetNextAddr(SocketPort(), &mNetAddr);
mDNSRecord->IsTRR(&mResolvedByTRR);
if (NS_SUCCEEDED(rv)) {
SOCKET_LOG((" trying again with next ip address\n"));
tryAgain = true;
@ -2098,7 +2096,6 @@ void nsSocketTransport::OnSocketEvent(uint32_t type, nsresult status,
mDNSTxtRequest = nullptr;
if (mDNSRecord) {
mDNSRecord->GetNextAddr(SocketPort(), &mNetAddr);
mDNSRecord->IsTRR(&mResolvedByTRR);
}
// status contains DNS lookup status
if (NS_FAILED(status)) {
@ -3526,11 +3523,5 @@ nsSocketTransport::GetEsniUsed(bool *aEsniUsed) {
return NS_OK;
}
NS_IMETHODIMP
nsSocketTransport::ResolvedByTRR(bool *aResolvedByTRR) {
*aResolvedByTRR = mResolvedByTRR;
return NS_OK;
}
} // namespace net
} // namespace mozilla

Просмотреть файл

@ -328,7 +328,6 @@ class nsSocketTransport final : public nsASocketHandler,
nsCOMPtr<nsICancelable> mDNSRequest;
nsCOMPtr<nsIDNSRecord> mDNSRecord;
bool mResolvedByTRR;
nsresult mDNSLookupStatus;
PRIntervalTime mDNSARequestFinished;

Просмотреть файл

@ -275,7 +275,7 @@ nsresult TRR::SendHTTPRequest() {
// update with each HEADERS or reply to a DATA with a WINDOW UPDATE
rv = internalChannel->SetInitialRwin(127 * 1024);
NS_ENSURE_SUCCESS(rv, rv);
rv = internalChannel->SetIsTRRServiceChannel(true);
rv = internalChannel->SetTrr(true);
NS_ENSURE_SUCCESS(rv, rv);
mAllowRFC1918 = gTRRService->AllowRFC1918();

Просмотреть файл

@ -118,7 +118,6 @@ nsDNSRecord::IsTRR(bool *retval) {
}
return NS_OK;
}
NS_IMETHODIMP
nsDNSRecord::GetNextAddr(uint16_t port, NetAddr *addr) {
if (mDone) {

Просмотреть файл

@ -476,19 +476,10 @@ ClassifierDummyChannel::SetBeConservative(bool aBeConservative) {
}
NS_IMETHODIMP
ClassifierDummyChannel::GetIsTRRServiceChannel(bool* aTrr) {
return NS_ERROR_NOT_IMPLEMENTED;
}
ClassifierDummyChannel::GetTrr(bool* aTrr) { return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHODIMP
ClassifierDummyChannel::SetIsTRRServiceChannel(bool aTrr) {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
ClassifierDummyChannel::GetIsResolvedByTRR(bool* aResolvedByTRR) {
return NS_ERROR_NOT_IMPLEMENTED;
}
ClassifierDummyChannel::SetTrr(bool aTrr) { return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHODIMP
ClassifierDummyChannel::GetTlsFlags(uint32_t* aTlsFlags) {

Просмотреть файл

@ -416,7 +416,7 @@ uint32_t Http2Session::RegisterStreamID(Http2Stream *stream, uint32_t aNewID) {
// don't count push streams here
MOZ_ASSERT(stream->Transaction(), "no transation for the stream!");
RefPtr<nsHttpConnectionInfo> ci(stream->Transaction()->ConnectionInfo());
if (ci && ci->GetIsTrrServiceChannel()) {
if (ci && ci->GetTrrUsed()) {
IncrementTrrCounter();
}
}

Просмотреть файл

@ -496,7 +496,7 @@ nsresult Http2Stream::ParseHttpRequestHeaders(const char *buf, uint32_t avail,
// if the "mother stream" had TRR, this one is a TRR stream too!
RefPtr<nsHttpConnectionInfo> ci(Transaction()->ConnectionInfo());
if (ci && ci->GetIsTrrServiceChannel()) {
if (ci && ci->GetTrrUsed()) {
mSession->IncrementTrrCounter();
}

Просмотреть файл

@ -196,8 +196,7 @@ HttpBaseChannel::HttpBaseChannel()
mAllowSpdy(true),
mAllowAltSvc(true),
mBeConservative(false),
mIsTRRServiceChannel(false),
mResolvedByTRR(false),
mTRR(false),
mResponseTimeoutEnabled(true),
mAllRedirectsSameOrigin(true),
mAllRedirectsPassTimingAllowCheck(true),
@ -2702,23 +2701,16 @@ HttpBaseChannel::SetBeConservative(bool aBeConservative) {
}
NS_IMETHODIMP
HttpBaseChannel::GetIsTRRServiceChannel(bool* aIsTRRServiceChannel) {
NS_ENSURE_ARG_POINTER(aIsTRRServiceChannel);
HttpBaseChannel::GetTrr(bool* aTRR) {
NS_ENSURE_ARG_POINTER(aTRR);
*aIsTRRServiceChannel = mIsTRRServiceChannel;
*aTRR = mTRR;
return NS_OK;
}
NS_IMETHODIMP
HttpBaseChannel::SetIsTRRServiceChannel(bool aIsTRRServiceChannel) {
mIsTRRServiceChannel = aIsTRRServiceChannel;
return NS_OK;
}
NS_IMETHODIMP
HttpBaseChannel::GetIsResolvedByTRR(bool* aResolvedByTRR) {
NS_ENSURE_ARG_POINTER(aResolvedByTRR);
*aResolvedByTRR = mResolvedByTRR;
HttpBaseChannel::SetTrr(bool aTRR) {
mTRR = aTRR;
return NS_OK;
}
@ -3585,7 +3577,7 @@ nsresult HttpBaseChannel::SetupReplacementChannel(nsIURI* newURI,
MOZ_ASSERT(NS_SUCCEEDED(rv));
rv = httpInternal->SetBeConservative(mBeConservative);
MOZ_ASSERT(NS_SUCCEEDED(rv));
rv = httpInternal->SetIsTRRServiceChannel(mIsTRRServiceChannel);
rv = httpInternal->SetTrr(mTRR);
MOZ_ASSERT(NS_SUCCEEDED(rv));
rv = httpInternal->SetTlsFlags(mTlsFlags);
MOZ_ASSERT(NS_SUCCEEDED(rv));

Просмотреть файл

@ -276,9 +276,8 @@ class HttpBaseChannel : public nsHashPropertyBag,
NS_IMETHOD SetAllowAltSvc(bool aAllowAltSvc) override;
NS_IMETHOD GetBeConservative(bool *aBeConservative) override;
NS_IMETHOD SetBeConservative(bool aBeConservative) override;
NS_IMETHOD GetIsTRRServiceChannel(bool *aTRR) override;
NS_IMETHOD SetIsTRRServiceChannel(bool aTRR) override;
NS_IMETHOD GetIsResolvedByTRR(bool *aResolvedByTRR) override;
NS_IMETHOD GetTrr(bool *aTRR) override;
NS_IMETHOD SetTrr(bool aTRR) override;
NS_IMETHOD GetTlsFlags(uint32_t *aTlsFlags) override;
NS_IMETHOD SetTlsFlags(uint32_t aTlsFlags) override;
NS_IMETHOD GetApiRedirectToURI(nsIURI **aApiRedirectToURI) override;
@ -702,12 +701,7 @@ class HttpBaseChannel : public nsHashPropertyBag,
// classification. If this is changed or removed, make sure we also update
// NS_ShouldClassifyChannel accordingly !!!
uint32_t mBeConservative : 1;
// If the current channel is used to as a TRR connection.
uint32_t mIsTRRServiceChannel : 1;
// If the request was performed to a TRR resolved IP address.
// Will be false if loading the resource does not create a connection
// (for example when it's loaded from the cache).
uint32_t mResolvedByTRR : 1;
uint32_t mTRR : 1;
uint32_t mResponseTimeoutEnabled : 1;
// A flag that should be false only if a cross-domain redirect occurred
uint32_t mAllRedirectsSameOrigin : 1;

Просмотреть файл

@ -406,7 +406,7 @@ class StartRequestEvent : public NeckoTargetChannelEvent<HttpChannelChild> {
const NetAddr& aPeerAddr, const uint32_t& aCacheKey,
const nsCString& altDataType, const int64_t& altDataLen,
const bool& deliveringAltData, const bool& aApplyConversion,
const bool& aIsResolvedByTRR, const ResourceTimingStruct& aTiming)
const ResourceTimingStruct& aTiming)
: NeckoTargetChannelEvent<HttpChannelChild>(aChild),
mChannelStatus(aChannelStatus),
mResponseHead(aResponseHead),
@ -427,7 +427,6 @@ class StartRequestEvent : public NeckoTargetChannelEvent<HttpChannelChild> {
mAltDataLen(altDataLen),
mDeliveringAltData(deliveringAltData),
mLoadInfoForwarder(loadInfoForwarder),
mIsResolvedByTRR(aIsResolvedByTRR),
mTiming(aTiming) {}
void Run() override {
@ -438,7 +437,7 @@ class StartRequestEvent : public NeckoTargetChannelEvent<HttpChannelChild> {
mCacheFetchCount, mCacheExpirationTime, mCachedCharset,
mSecurityInfoSerialization, mSelfAddr, mPeerAddr, mCacheKey,
mAltDataType, mAltDataLen, mDeliveringAltData, mApplyConversion,
mIsResolvedByTRR, mTiming);
mTiming);
}
private:
@ -461,7 +460,6 @@ class StartRequestEvent : public NeckoTargetChannelEvent<HttpChannelChild> {
int64_t mAltDataLen;
bool mDeliveringAltData;
ParentLoadInfoForwarderArgs mLoadInfoForwarder;
bool mIsResolvedByTRR;
ResourceTimingStruct mTiming;
};
@ -476,8 +474,7 @@ mozilla::ipc::IPCResult HttpChannelChild::RecvOnStartRequest(
const NetAddr& peerAddr, const int16_t& redirectCount,
const uint32_t& cacheKey, const nsCString& altDataType,
const int64_t& altDataLen, const bool& deliveringAltData,
const bool& aApplyConversion, const bool& aIsResolvedByTRR,
const ResourceTimingStruct& aTiming) {
const bool& aApplyConversion, const ResourceTimingStruct& aTiming) {
AUTO_PROFILER_LABEL("HttpChannelChild::RecvOnStartRequest", NETWORK);
LOG(("HttpChannelChild::RecvOnStartRequest [this=%p]\n", this));
// mFlushedForDiversion and mDivertingToParent should NEVER be set at this
@ -496,8 +493,7 @@ mozilla::ipc::IPCResult HttpChannelChild::RecvOnStartRequest(
loadInfoForwarder, isFromCache, cacheEntryAvailable, cacheEntryId,
cacheFetchCount, cacheExpirationTime, cachedCharset,
securityInfoSerialization, selfAddr, peerAddr, cacheKey, altDataType,
altDataLen, deliveringAltData, aApplyConversion, aIsResolvedByTRR,
aTiming));
altDataLen, deliveringAltData, aApplyConversion, aTiming));
{
// Child's mEventQ is to control the execution order of the IPC messages
@ -531,7 +527,7 @@ void HttpChannelChild::OnStartRequest(
const NetAddr& peerAddr, const uint32_t& cacheKey,
const nsCString& altDataType, const int64_t& altDataLen,
const bool& deliveringAltData, const bool& aApplyConversion,
const bool& aIsResolvedByTRR, const ResourceTimingStruct& aTiming) {
const ResourceTimingStruct& aTiming) {
LOG(("HttpChannelChild::OnStartRequest [this=%p]\n", this));
// mFlushedForDiversion and mDivertingToParent should NEVER be set at this
@ -584,7 +580,6 @@ void HttpChannelChild::OnStartRequest(
mAvailableCachedAltDataType = altDataType;
mDeliveringAltData = deliveringAltData;
mAltDataLength = altDataLen;
mResolvedByTRR = aIsResolvedByTRR;
SetApplyConversion(aApplyConversion);

Просмотреть файл

@ -145,7 +145,7 @@ class HttpChannelChild final : public PHttpChannelChild,
const NetAddr& peerAddr, const int16_t& redirectCount,
const uint32_t& cacheKey, const nsCString& altDataType,
const int64_t& altDataLen, const bool& deliveringAltData,
const bool& aApplyConversion, const bool& aIsResolvedByTRR,
const bool& aApplyConversion,
const ResourceTimingStruct& aTiming) override;
mozilla::ipc::IPCResult RecvFailedAsyncOpen(const nsresult& status) override;
mozilla::ipc::IPCResult RecvRedirect1Begin(
@ -470,7 +470,7 @@ class HttpChannelChild final : public PHttpChannelChild,
const NetAddr& peerAddr, const uint32_t& cacheKey,
const nsCString& altDataType, const int64_t& altDataLen,
const bool& deliveringAltData, const bool& aApplyConversion,
const bool& aIsResolvedByTRR, const ResourceTimingStruct& aTiming);
const ResourceTimingStruct& aTiming);
void MaybeDivertOnData(const nsCString& data, const uint64_t& offset,
const uint32_t& count);
void OnTransportAndData(const nsresult& channelStatus, const nsresult& status,

Просмотреть файл

@ -1461,9 +1461,6 @@ HttpChannelParent::OnStartRequest(nsIRequest* aRequest) {
ResourceTimingStruct timing;
GetTimingAttributes(mChannel, timing);
bool isResolvedByTRR = false;
chan->GetIsResolvedByTRR(&isResolvedByTRR);
rv = NS_OK;
if (mIPCClosed ||
!SendOnStartRequest(
@ -1473,7 +1470,7 @@ HttpChannelParent::OnStartRequest(nsIRequest* aRequest) {
cacheEntryId, fetchCount, expirationTime, cachedCharset,
secInfoSerialization, chan->GetSelfAddr(), chan->GetPeerAddr(),
redirectCount, cacheKey, altDataType, altDataLen, deliveringAltData,
applyConversion, isResolvedByTRR, timing)) {
applyConversion, timing)) {
rv = NS_ERROR_UNEXPECTED;
}
requestHead->Exit();

Просмотреть файл

@ -126,7 +126,6 @@ child:
int64_t altDataLength,
bool deliveringAltData,
bool applyConversion,
bool isResolvedByTRR,
ResourceTimingStruct timing);
// Used to cancel child channel if we hit errors during creating and

Просмотреть файл

@ -1827,14 +1827,6 @@ SocketTransportShim::GetEsniUsed(bool *aEsniUsed) {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
SocketTransportShim::ResolvedByTRR(bool *aResolvedByTRR) {
if (mIsWebsocket) {
LOG3(("WARNING: SocketTransportShim::IsTRR %p", this));
}
return NS_ERROR_NOT_IMPLEMENTED;
}
#define FWD_TS_PTR(fx, ts) \
NS_IMETHODIMP \
SocketTransportShim::fx(ts *arg) { return mWrapped->fx(arg); }

Просмотреть файл

@ -617,7 +617,7 @@ nsresult nsHttpChannel::ContinueOnBeforeConnect(bool aShouldUpgrade,
}
}
if (mIsTRRServiceChannel) {
if (mTRR) {
mCaps |= NS_HTTP_LARGE_KEEPALIVE | NS_HTTP_DISABLE_TRR;
}
@ -632,7 +632,7 @@ nsresult nsHttpChannel::ContinueOnBeforeConnect(bool aShouldUpgrade,
mConnectionInfo->SetBeConservative((mCaps & NS_HTTP_BE_CONSERVATIVE) ||
mBeConservative);
mConnectionInfo->SetTlsFlags(mTlsFlags);
mConnectionInfo->SetIsTrrServiceChannel(mIsTRRServiceChannel);
mConnectionInfo->SetTrrUsed(mTRR);
mConnectionInfo->SetTrrDisabled(mCaps & NS_HTTP_DISABLE_TRR);
mConnectionInfo->SetIPv4Disabled(mCaps & NS_HTTP_DISABLE_IPV4);
mConnectionInfo->SetIPv6Disabled(mCaps & NS_HTTP_DISABLE_IPV6);
@ -4037,7 +4037,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(
if (mPostID) {
extension.Append(nsPrintfCString("%d", mPostID));
}
if (mIsTRRServiceChannel) {
if (mTRR) {
extension.Append("TRR");
}
@ -8429,15 +8429,11 @@ nsHttpChannel::OnTransportStatus(nsITransport *trans, nsresult status,
status == NS_NET_STATUS_WAITING_FOR) {
if (mTransaction) {
mTransaction->GetNetworkAddresses(mSelfAddr, mPeerAddr);
mResolvedByTRR = mTransaction->ResolvedByTRR();
} else {
nsCOMPtr<nsISocketTransport> socketTransport = do_QueryInterface(trans);
if (socketTransport) {
socketTransport->GetSelfAddr(&mSelfAddr);
socketTransport->GetPeerAddr(&mPeerAddr);
bool isTrr = false;
socketTransport->ResolvedByTRR(&isTrr);
mResolvedByTRR = isTrr;
}
}
}

Просмотреть файл

@ -139,7 +139,7 @@ nsHttpConnection::~nsHttpConnection() {
}
MOZ_ASSERT(ci);
if (ci->GetIsTrrServiceChannel()) {
if (ci->GetTrrUsed()) {
Telemetry::Accumulate(Telemetry::DNS_TRR_REQUEST_PER_CONN,
mHttp1xTransactionCount);
}

Просмотреть файл

@ -81,7 +81,7 @@ void nsHttpConnectionInfo::Init(const nsACString &host, int32_t port,
mNPNToken = npnToken;
mOriginAttributes = originAttributes;
mTlsFlags = 0x0;
mIsTrrServiceChannel = false;
mTrrUsed = false;
mTrrDisabled = false;
mIPv4Disabled = false;
mIPv6Disabled = false;
@ -250,7 +250,7 @@ already_AddRefed<nsHttpConnectionInfo> nsHttpConnectionInfo::Clone() const {
clone->SetNoSpdy(GetNoSpdy());
clone->SetBeConservative(GetBeConservative());
clone->SetTlsFlags(GetTlsFlags());
clone->SetIsTrrServiceChannel(GetIsTrrServiceChannel());
clone->SetTrrUsed(GetTrrUsed());
clone->SetTrrDisabled(GetTrrDisabled());
clone->SetIPv4Disabled(GetIPv4Disabled());
clone->SetIPv6Disabled(GetIPv6Disabled());
@ -276,7 +276,7 @@ void nsHttpConnectionInfo::CloneAsDirectRoute(nsHttpConnectionInfo **outCI) {
clone->SetNoSpdy(GetNoSpdy());
clone->SetBeConservative(GetBeConservative());
clone->SetTlsFlags(GetTlsFlags());
clone->SetIsTrrServiceChannel(GetIsTrrServiceChannel());
clone->SetTrrUsed(GetTrrUsed());
clone->SetTrrDisabled(GetTrrDisabled());
clone->SetIPv4Disabled(GetIPv4Disabled());
clone->SetIPv6Disabled(GetIPv6Disabled());

Просмотреть файл

@ -125,12 +125,9 @@ class nsHttpConnectionInfo final : public ARefBase {
void SetTlsFlags(uint32_t aTlsFlags);
uint32_t GetTlsFlags() const { return mTlsFlags; }
// IsTrrServiceChannel means that this connection is used to send TRR requests
// over
void SetIsTrrServiceChannel(bool aIsTRRChannel) {
mIsTrrServiceChannel = aIsTRRChannel;
}
bool GetIsTrrServiceChannel() const { return mIsTrrServiceChannel; }
// TrrUsed means that this connection is used to send TRR requests over
void SetTrrUsed(bool aUsed) { mTrrUsed = aUsed; }
bool GetTrrUsed() const { return mTrrUsed; }
// SetTrrDisabled means don't use TRR to resolve host names for this
// connection
@ -198,7 +195,7 @@ class nsHttpConnectionInfo final : public ARefBase {
OriginAttributes mOriginAttributes;
uint32_t mTlsFlags;
uint16_t mIsTrrServiceChannel : 1;
uint16_t mTrrUsed : 1;
uint16_t mTrrDisabled : 1;
uint16_t mIPv4Disabled : 1;
uint16_t mIPv6Disabled : 1;

Просмотреть файл

@ -143,7 +143,6 @@ nsHttpTransaction::nsHttpTransaction()
mPassedRatePacing(false),
mSynchronousRatePaceRequest(false),
mClassOfService(0),
mResolvedByTRR(false),
m0RTTInProgress(false),
mDoNotTryEarlyData(false),
mEarlyDataDisposition(EARLY_NONE),
@ -592,7 +591,6 @@ void nsHttpTransaction::OnTransportStatus(nsITransport *transport,
MutexAutoLock lock(mLock);
socketTransport->GetSelfAddr(&mSelfAddr);
socketTransport->GetPeerAddr(&mPeerAddr);
socketTransport->ResolvedByTRR(&mResolvedByTRR);
}
}

Просмотреть файл

@ -464,12 +464,10 @@ class nsHttpTransaction final : public nsAHttpTransaction,
public:
void GetNetworkAddresses(NetAddr &self, NetAddr &peer);
bool ResolvedByTRR() { return mResolvedByTRR; }
private:
NetAddr mSelfAddr;
NetAddr mPeerAddr;
bool mResolvedByTRR;
bool m0RTTInProgress;
bool mDoNotTryEarlyData;

Просмотреть файл

@ -243,14 +243,7 @@ interface nsIHttpChannelInternal : nsISupports
* True if channel is used by the internal trusted recursive resolver
* This flag places data for the request in a cache segment specific to TRR
*/
[noscript, must_use] attribute boolean isTRRServiceChannel;
/**
* If the channel's remote IP was resolved using TRR.
* Is false for resources loaded from the cache or resources that have an
* IP literal host.
*/
[noscript, must_use] readonly attribute boolean isResolvedByTRR;
[noscript, must_use] attribute boolean trr;
/**
* An opaque flags for non-standard behavior of the TLS system.