summaryrefslogtreecommitdiffstats
path: root/toolkit/components/resistfingerprinting/nsIRFPService.idl
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/resistfingerprinting/nsIRFPService.idl')
-rw-r--r--toolkit/components/resistfingerprinting/nsIRFPService.idl80
1 files changed, 80 insertions, 0 deletions
diff --git a/toolkit/components/resistfingerprinting/nsIRFPService.idl b/toolkit/components/resistfingerprinting/nsIRFPService.idl
new file mode 100644
index 0000000000..b81868d202
--- /dev/null
+++ b/toolkit/components/resistfingerprinting/nsIRFPService.idl
@@ -0,0 +1,80 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsISupports.idl"
+#include "nsIFingerprintingWebCompatService.idl"
+
+interface nsIPrincipal;
+interface nsIChannel;
+
+/**
+ * The singleton serivce which handles fingerprinting protection stuffs.
+ */
+[scriptable, builtinclass, uuid(20093b2e-d5d5-4ce0-8355-96b8d2dc7ff5)]
+interface nsIRFPService : nsISupports
+{
+ /**
+ * Set the fingerprinting overrides.
+ *
+ * @param aOverrides
+ * An array of fingerprinting overrides.
+ */
+ void setFingerprintingOverrides(in Array<nsIFingerprintingOverride> aOverrides);
+
+ /**
+ * Get the fingerprinting overrides of the given scope. This is for testing
+ * purpose.
+ *
+ * @param aScope
+ * The scope of the fingerprinting override.
+ * @return The RFPTarget flags for the fingerprinting overrides of the given
+ * scope. 0 if the overridden scope doesn't exist.
+ *
+ */
+ uint64_t getFingerprintingOverrides(in ACString aDomainKey);
+
+ /**
+ * Clean all overrides. This is for testing purpose.
+ */
+ void cleanAllOverrides();
+
+ /**
+ * The bitfield of the default enabled RFP Targets.
+ */
+ readonly attribute uint64_t enabledFingerprintingProtections;
+
+ /**
+ * Clean all fingerprinting randomization keys.
+ */
+ void cleanAllRandomKeys();
+
+ /**
+ * Clean the fingerprinting randomization key by the given principal.
+ */
+ void cleanRandomKeyByPrincipal(in nsIPrincipal aPrincipal);
+
+ /**
+ * Clean the fingerprinting randomization key by the given domain.
+ */
+ void cleanRandomKeyByDomain(in ACString aDomain);
+
+ /**
+ * Clean the fingerprinting randomization key by the given host and
+ * OriginAttributesPattern.
+ */
+ void cleanRandomKeyByHost(in ACString aHost,
+ in AString aPattern);
+
+ /**
+ * Clean the fingerprinting randomization key by the given
+ * OriginAttributesPattern.
+ */
+ void cleanRandomKeyByOriginAttributesPattern(in AString aPattern);
+
+ /**
+ * Test function for generating and return the fingerprinting randomization
+ * key for the given channel.
+ */
+ Array<uint8_t> testGenerateRandomKey(in nsIChannel aChannel);
+};