Commit 2a35015f authored by Erica Wright's avatar Erica Wright
Browse files

Bug 1589753 - Add telemetry for users clearing data on shutdown. r=johannh

Differential Revision: https://phabricator.services.mozilla.com/D50124

--HG--
extra : moz-landing-system : lando
parent 68ef0058
......@@ -1834,6 +1834,70 @@ BrowserGlue.prototype = {
});
},
_recordDataSanitizationPrefs() {
Services.telemetry.scalarSet(
"datasanitization.network_cookie_lifetimePolicy",
Services.prefs.getIntPref("network.cookie.lifetimePolicy")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_sanitize_sanitizeOnShutdown",
Services.prefs.getBoolPref("privacy.sanitize.sanitizeOnShutdown")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_clearOnShutdown_cookies",
Services.prefs.getBoolPref("privacy.clearOnShutdown.cookies")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_clearOnShutdown_history",
Services.prefs.getBoolPref("privacy.clearOnShutdown.history")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_clearOnShutdown_formdata",
Services.prefs.getBoolPref("privacy.clearOnShutdown.formdata")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_clearOnShutdown_downloads",
Services.prefs.getBoolPref("privacy.clearOnShutdown.downloads")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_clearOnShutdown_cache",
Services.prefs.getBoolPref("privacy.clearOnShutdown.cache")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_clearOnShutdown_sessions",
Services.prefs.getBoolPref("privacy.clearOnShutdown.sessions")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_clearOnShutdown_offlineApps",
Services.prefs.getBoolPref("privacy.clearOnShutdown.offlineApps")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_clearOnShutdown_siteSettings",
Services.prefs.getBoolPref("privacy.clearOnShutdown.siteSettings")
);
Services.telemetry.scalarSet(
"datasanitization.privacy_clearOnShutdown_openWindows",
Services.prefs.getBoolPref("privacy.clearOnShutdown.openWindows")
);
let exceptions = 0;
for (let permission of Services.perms.all) {
let uri = permission.principal.URI;
// We consider just permissions set for http, https and file URLs.
if (
permission.type == "cookie" &&
permission.capability == Ci.nsICookiePermission.ACCESS_SESSION &&
(uri.scheme == "http" || uri.scheme == "https" || uri.scheme == "file")
) {
exceptions++;
}
}
Services.telemetry.scalarSet(
"datasanitization.session_permission_exceptions",
exceptions
);
},
_sendMediaTelemetry() {
let win = Services.wm.getMostRecentWindow("navigator:browser");
if (win) {
......@@ -2060,6 +2124,10 @@ BrowserGlue.prototype = {
this._recordContentBlockerTelemetry();
});
Services.tm.idleDispatchToMainThread(() => {
this._recordDataSanitizationPrefs();
});
// Load the Login Manager data from disk off the main thread, some time
// after startup. If the data is required before this runs, for example
// because a restored page contains a password field, it will be loaded on
......
......@@ -837,6 +837,41 @@ class PrincipalsCollector {
async function sanitizeOnShutdown(progress) {
log("Sanitizing on shutdown");
progress.sanitizationPrefs = {
network_cookie_lifetimePolicy: Services.prefs.getIntPref(
"network.cookie.lifetimePolicy"
),
privacy_sanitize_sanitizeOnShutdown: Services.prefs.getBoolPref(
"privacy.sanitize.sanitizeOnShutdown"
),
privacy_clearOnShutdown_cookies: Services.prefs.getBoolPref(
"privacy.clearOnShutdown.cookies"
),
privacy_clearOnShutdown_history: Services.prefs.getBoolPref(
"privacy.clearOnShutdown.history"
),
privacy_clearOnShutdown_formdata: Services.prefs.getBoolPref(
"privacy.clearOnShutdown.formdata"
),
privacy_clearOnShutdown_downloads: Services.prefs.getBoolPref(
"privacy.clearOnShutdown.downloads"
),
privacy_clearOnShutdown_cache: Services.prefs.getBoolPref(
"privacy.clearOnShutdown.cache"
),
privacy_clearOnShutdown_sessions: Services.prefs.getBoolPref(
"privacy.clearOnShutdown.sessions"
),
privacy_clearOnShutdown_offlineApps: Services.prefs.getBoolPref(
"privacy.clearOnShutdown.offlineApps"
),
privacy_clearOnShutdown_siteSettings: Services.prefs.getBoolPref(
"privacy.clearOnShutdown.siteSettings"
),
privacy_clearOnShutdown_openWindows: Services.prefs.getBoolPref(
"privacy.clearOnShutdown.openWindows"
),
};
let needsSyncSavePrefs = false;
if (Sanitizer.shouldSanitizeOnShutdown) {
......@@ -906,6 +941,7 @@ async function sanitizeOnShutdown(progress) {
progress.advancement = "session-permission";
let exceptions = 0;
// Let's see if we have to forget some particular site.
for (let permission of Services.perms.all) {
if (
......@@ -924,6 +960,7 @@ async function sanitizeOnShutdown(progress) {
"Custom session cookie permission detected for: " +
permission.principal.URI.spec
);
exceptions++;
// We use just the URI here, because permissions ignore OriginAttributes.
let principals = await principalsCollector.getAllPrincipals(progress);
......@@ -933,7 +970,7 @@ async function sanitizeOnShutdown(progress) {
);
await maybeSanitizeSessionPrincipals(progress, selectedPrincipals);
}
progress.sanitizationPrefs.session_permission_exceptions = exceptions;
progress.advancement = "done";
}
......
......@@ -742,6 +742,188 @@ contentblocking:
record_in_processes:
- main
datasanitization:
network_cookie_lifetimePolicy:
bug_numbers:
- 1589753
description: >
This scalar reports the value of the network.cookie.lifetimePolicy pref.
expires: "76"
kind: uint
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_sanitize_sanitizeOnShutdown:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.sanitize.sanitizeOnShutdown pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_clearOnShutdown_cookies:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.clearOnShutdown.cookies pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_clearOnShutdown_history:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.clearOnShutdown.history pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_clearOnShutdown_formdata:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.clearOnShutdown.formdata pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_clearOnShutdown_downloads:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.clearOnShutdown.downloads pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_clearOnShutdown_cache:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.clearOnShutdown.cache pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_clearOnShutdown_sessions:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.clearOnShutdown.sessions pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_clearOnShutdown_offlineApps:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.clearOnShutdown.offlineApps pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_clearOnShutdown_siteSettings:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.clearOnShutdown.siteSettings pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
privacy_clearOnShutdown_openWindows:
bug_numbers:
- 1589753
description: >
A boolean reporting the value of the privacy.clearOnShutdown.openWindows pref.
expires: "76"
kind: boolean
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
session_permission_exceptions:
bug_numbers:
- 1589753
description: >
A count of how many "session" cookie exceptions a user has set.
expires: "76"
kind: uint
notification_emails:
- ewright@mozilla.com
- seceng-telemetry@mozilla.com
release_channel_collection: opt-in
products:
- 'firefox'
record_in_processes:
- main
sandbox:
no_job:
bug_numbers:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment