зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1491835 - Store User-Interaction for AntiTracking purposes - part 1 - nsIDocument::SetUserHasInteracted should not receive a parameter, r=ehsan
This commit is contained in:
Родитель
68a73ded70
Коммит
55aa7576b0
|
@ -12622,20 +12622,22 @@ nsIDocument::ReportHasScrollLinkedEffect()
|
|||
}
|
||||
|
||||
void
|
||||
nsIDocument::SetUserHasInteracted(bool aUserHasInteracted)
|
||||
nsIDocument::SetUserHasInteracted()
|
||||
{
|
||||
MOZ_LOG(gUserInteractionPRLog, LogLevel::Debug,
|
||||
("Document %p has been interacted by user.", this));
|
||||
mUserHasInteracted = aUserHasInteracted;
|
||||
if (mUserHasInteracted) {
|
||||
return;
|
||||
}
|
||||
|
||||
mUserHasInteracted = true;
|
||||
|
||||
nsCOMPtr<nsILoadInfo> loadInfo = mChannel ? mChannel->GetLoadInfo() : nullptr;
|
||||
if (loadInfo) {
|
||||
loadInfo->SetDocumentHasUserInteracted(aUserHasInteracted);
|
||||
loadInfo->SetDocumentHasUserInteracted(true);
|
||||
}
|
||||
|
||||
if (aUserHasInteracted) {
|
||||
MaybeAllowStorageForOpener();
|
||||
}
|
||||
MaybeAllowStorageForOpener();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -3500,7 +3500,7 @@ public:
|
|||
|
||||
// Called to track whether this document has had any interaction.
|
||||
// This is used to track whether we should permit "beforeunload".
|
||||
void SetUserHasInteracted(bool aUserHasInteracted);
|
||||
void SetUserHasInteracted();
|
||||
bool UserHasInteracted()
|
||||
{
|
||||
return mUserHasInteracted;
|
||||
|
|
|
@ -505,7 +505,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||
aEvent->mMessage == ePointerUp)) {
|
||||
nsIDocument* doc = node->OwnerDoc();
|
||||
while (doc && !doc->UserHasInteracted()) {
|
||||
doc->SetUserHasInteracted(true);
|
||||
doc->SetUserHasInteracted();
|
||||
doc = nsContentUtils::IsChildOfSameType(doc) ?
|
||||
doc->GetParentDocument() : nullptr;
|
||||
}
|
||||
|
|
|
@ -3418,7 +3418,5 @@ nsHTMLDocument::GetFormsAndFormControls(nsContentList** aFormList,
|
|||
void
|
||||
nsHTMLDocument::UserInteractionForTesting()
|
||||
{
|
||||
if (!UserHasInteracted()) {
|
||||
SetUserHasInteracted(true);
|
||||
}
|
||||
SetUserHasInteracted();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче