Bug 1415342 - Part 3 - Clear MediaMmanager deviceIds when clearing cookies. r?esawin
There is at least one reference to the MediaManagerService being used within
mobile in conjunction with WebRTC, so we should do the same thing that desktop
Firefox is doing here.
MozReview-Commit-ID: 1z1cLapxK2F
--- a/mobile/android/modules/Sanitizer.jsm
+++ b/mobile/android/modules/Sanitizer.jsm
@@ -98,16 +98,24 @@ Sanitizer.prototype = {
clear: function() {
return new Promise(function(resolve, reject) {
let refObj = {};
TelemetryStopwatch.start("FX_SANITIZE_COOKIES_2", refObj);
Services.cookies.removeAll();
TelemetryStopwatch.finish("FX_SANITIZE_COOKIES_2", refObj);
+
+ // Clear deviceIds. Done asynchronously (returns before complete).
+ try {
+ let mediaMgr = Cc["@mozilla.org/mediaManagerService;1"]
+ .getService(Ci.nsIMediaManagerService);
+ mediaMgr.sanitizeDeviceIds(0);
+ } catch (er) { }
+
resolve();
});
},
get canClear() {
return true;
}
},