зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1462432 - Part 1: Add an API to override the tracking status on an HTTP channel; r=mayhemer
This commit is contained in:
Родитель
d6e2c6a0f3
Коммит
f4e3e1d715
|
@ -1546,6 +1546,17 @@ HttpBaseChannel::GetIsTrackingResource(bool* aIsTrackingResource)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HttpBaseChannel::OverrideTrackingResource(bool aIsTracking)
|
||||
{
|
||||
LOG(("HttpBaseChannel::OverrideTrackingResource(%d) %p "
|
||||
"mIsTrackingResource=%d",
|
||||
(int) aIsTracking, this, (int) mIsTrackingResource));
|
||||
|
||||
mIsTrackingResource = aIsTracking;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HttpBaseChannel::GetTransferSize(uint64_t *aTransferSize)
|
||||
{
|
||||
|
|
|
@ -211,6 +211,7 @@ public:
|
|||
NS_IMETHOD GetTopLevelOuterContentWindowId(uint64_t *aWindowId) override;
|
||||
NS_IMETHOD SetTopLevelOuterContentWindowId(uint64_t aWindowId) override;
|
||||
NS_IMETHOD GetIsTrackingResource(bool* aIsTrackingResource) override;
|
||||
NS_IMETHOD OverrideTrackingResource(bool aIsTracking) override;
|
||||
|
||||
// nsIHttpChannelInternal
|
||||
NS_IMETHOD GetDocumentURI(nsIURI **aDocumentURI) override;
|
||||
|
|
|
@ -99,6 +99,12 @@ NullHttpChannel::GetIsTrackingResource(bool* aIsTrackingResource)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NullHttpChannel::OverrideTrackingResource(bool aIsTracking)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NullHttpChannel::GetTransferSize(uint64_t *aTransferSize)
|
||||
{
|
||||
|
|
|
@ -482,6 +482,16 @@ interface nsIHttpChannel : nsIChannel
|
|||
*/
|
||||
[infallible] readonly attribute boolean isTrackingResource;
|
||||
|
||||
/**
|
||||
* This method is used in order to override the tracking status of an HTTP
|
||||
* channel. This should only be called by Gecko under certain circumstances
|
||||
* when Gecko can guarantee that the channel classifier service will not be
|
||||
* determining the tracking status of the channel.
|
||||
*
|
||||
* Please avoid calling this API if you're unsure whether you should be using it.
|
||||
*/
|
||||
[noscript] void overrideTrackingResource(in boolean aIsTracking);
|
||||
|
||||
/**
|
||||
* ID of the top-level outer content window. Identifies this channel's
|
||||
* top-level window it comes from.
|
||||
|
|
|
@ -836,6 +836,13 @@ nsViewSourceChannel::GetIsTrackingResource(bool* aIsTrackingResource)
|
|||
mHttpChannel->GetIsTrackingResource(aIsTrackingResource);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsViewSourceChannel::OverrideTrackingResource(bool aIsTracking)
|
||||
{
|
||||
return !mHttpChannel ? NS_ERROR_NULL_POINTER :
|
||||
mHttpChannel->OverrideTrackingResource(aIsTracking);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsViewSourceChannel::GetRequestMethod(nsACString & aRequestMethod)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче