Commit 2536630f authored by Tom Schuster's avatar Tom Schuster
Browse files

Bug 1818250 - Add ShouldResistFingerprinting to WindowContext. r=nika

parent d996ac63
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -227,6 +227,12 @@ bool WindowContext::CanSet(FieldIndex<IDX_IsThirdPartyTrackingResourceWindow>,
  return CheckOnlyOwningProcessCanSet(aSource);
}

bool WindowContext::CanSet(FieldIndex<IDX_ShouldResistFingerprinting>,
                           const bool& aShouldResistFingerprinting,
                           ContentParent* aSource) {
  return CheckOnlyOwningProcessCanSet(aSource);
}

bool WindowContext::CanSet(FieldIndex<IDX_IsSecureContext>,
                           const bool& aIsSecureContext,
                           ContentParent* aSource) {
+7 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ class BrowsingContextGroup;
  /* Whether this window's channel has been marked as a third-party      \
   * tracking resource */                                                \
  FIELD(IsThirdPartyTrackingResourceWindow, bool)                        \
  FIELD(ShouldResistFingerprinting, bool)                                \
  FIELD(IsSecureContext, bool)                                           \
  FIELD(IsOriginalFrameSource, bool)                                     \
  /* Mixed-Content: If the corresponding documentURI is https,           \
@@ -127,6 +128,10 @@ class WindowContext : public nsISupports, public nsWrapperCache {

  bool IsLocalIP() const { return GetIsLocalIP(); }

  bool ShouldResistFingerprinting() const {
    return GetShouldResistFingerprinting();
  }

  nsGlobalWindowInner* GetInnerWindow() const;
  Document* GetDocument() const;
  Document* GetExtantDoc() const;
@@ -261,6 +266,8 @@ class WindowContext : public nsISupports, public nsWrapperCache {
  bool CanSet(FieldIndex<IDX_IsThirdPartyTrackingResourceWindow>,
              const bool& aIsThirdPartyTrackingResourceWindow,
              ContentParent* aSource);
  bool CanSet(FieldIndex<IDX_ShouldResistFingerprinting>,
              const bool& aShouldResistFingerprinting, ContentParent* aSource);
  bool CanSet(FieldIndex<IDX_IsSecureContext>, const bool& aIsSecureContext,
              ContentParent* aSource);
  bool CanSet(FieldIndex<IDX_IsOriginalFrameSource>,
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ interface WindowContext {
  // True if the principal of this window is for a local ip address.
  readonly attribute boolean isLocalIP;

  readonly attribute boolean shouldResistFingerprinting;

  /**
   * Partially determines whether script execution is allowed in this
   * BrowsingContext. Script execution will be permitted only if this
+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ WindowGlobalInit WindowGlobalActor::WindowInitializer(
  fields.mIsThirdPartyWindow = doc->HasThirdPartyChannel();
  fields.mIsThirdPartyTrackingResourceWindow =
      nsContentUtils::IsThirdPartyTrackingResourceWindow(aWindow);
  fields.mShouldResistFingerprinting = doc->ShouldResistFingerprinting();
  fields.mIsSecureContext = aWindow->IsSecureContext();

  // Initialze permission fields