forked from mirrors/gecko-dev
Bug 1602940 - Automated replacements to use Services.uuid. r=Gijs,necko-reviewers,preferences-reviewers,kershaw
Depends on D124391 Differential Revision: https://phabricator.services.mozilla.com/D124392
This commit is contained in:
parent
01a583ac70
commit
11bfa90d06
54 changed files with 56 additions and 176 deletions
|
|
@ -29,9 +29,7 @@ var BlocklistProxy = {
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
if (!this._uuid) {
|
if (!this._uuid) {
|
||||||
this._uuid = Cc["@mozilla.org/uuid-generator;1"]
|
this._uuid = Services.uuid.generateUUID();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID();
|
|
||||||
Cm.nsIComponentRegistrar.registerFactory(
|
Cm.nsIComponentRegistrar.registerFactory(
|
||||||
this._uuid,
|
this._uuid,
|
||||||
"",
|
"",
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
const DUMMY_FILE = "dummy_page.html";
|
const DUMMY_FILE = "dummy_page.html";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,8 +198,7 @@ add_task(async function test_broken_referrer() {
|
||||||
// application has quarantine data but nothing will be pressent in the
|
// application has quarantine data but nothing will be pressent in the
|
||||||
// quarantine database. This shouldn't happen in the wild.
|
// quarantine database. This shouldn't happen in the wild.
|
||||||
function generateQuarantineGUID() {
|
function generateQuarantineGUID() {
|
||||||
let str = Cc["@mozilla.org/uuid-generator;1"]
|
let str = Services.uuid
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
.generateUUID()
|
||||||
.toString()
|
.toString()
|
||||||
.toUpperCase();
|
.toUpperCase();
|
||||||
|
|
|
||||||
|
|
@ -402,10 +402,7 @@ async function updateStudy(studyAddonId) {
|
||||||
// equivalent to what we use for Telemetry IDs
|
// equivalent to what we use for Telemetry IDs
|
||||||
// https://searchfox.org/mozilla-central/rev/9193635dca8cfdcb68f114306194ffc860456044/toolkit/components/telemetry/app/TelemetryUtils.jsm#222
|
// https://searchfox.org/mozilla-central/rev/9193635dca8cfdcb68f114306194ffc860456044/toolkit/components/telemetry/app/TelemetryUtils.jsm#222
|
||||||
function generateUUID() {
|
function generateUUID() {
|
||||||
let str = Cc["@mozilla.org/uuid-generator;1"]
|
let str = Services.uuid.generateUUID().toString();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
|
||||||
.toString();
|
|
||||||
return str.substring(1, str.length - 1);
|
return str.substring(1, str.length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,7 @@
|
||||||
|
|
||||||
const Cm = Components.manager;
|
const Cm = Components.manager;
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
const mockUpdateManager = {
|
const mockUpdateManager = {
|
||||||
contractId: "@mozilla.org/updates/update-manager;1",
|
contractId: "@mozilla.org/updates/update-manager;1",
|
||||||
|
|
|
||||||
|
|
@ -105,9 +105,7 @@ add_task(async function() {
|
||||||
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(
|
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(
|
||||||
Ci.nsIDirectoryServiceProvider
|
Ci.nsIDirectoryServiceProvider
|
||||||
);
|
);
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
let shellSvc = Cc["@mozilla.org/browser/shell-service;1"].getService(
|
let shellSvc = Cc["@mozilla.org/browser/shell-service;1"].getService(
|
||||||
Ci.nsIShellService
|
Ci.nsIShellService
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -109,9 +109,7 @@ let buttonCount = AppConstants.MOZ_DEV_EDITION ? 2 : 1;
|
||||||
add_task(async function setup() {
|
add_task(async function setup() {
|
||||||
// Create a fake WebExtensionPolicy that we can use for
|
// Create a fake WebExtensionPolicy that we can use for
|
||||||
// the add-on hang notification.
|
// the add-on hang notification.
|
||||||
const uuidGen = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGen = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
const uuid = uuidGen.generateUUID().number.slice(1, -1);
|
const uuid = uuidGen.generateUUID().number.slice(1, -1);
|
||||||
let policy = new WebExtensionPolicy({
|
let policy = new WebExtensionPolicy({
|
||||||
name: "Scapegoat",
|
name: "Scapegoat",
|
||||||
|
|
|
||||||
|
|
@ -106,9 +106,7 @@ function createPendingCrashReports(howMany, accessDate) {
|
||||||
return Promise.all(promises);
|
return Promise.all(promises);
|
||||||
};
|
};
|
||||||
|
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
// Some annotations are always present in the .extra file and CrashSubmit.jsm
|
// Some annotations are always present in the .extra file and CrashSubmit.jsm
|
||||||
// expects there to be a ServerURL entry, so we'll add them here.
|
// expects there to be a ServerURL entry, so we'll add them here.
|
||||||
let extraFileContents = JSON.stringify({
|
let extraFileContents = JSON.stringify({
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,7 @@ var manifests = [do_get_file("data/test_data_protocol_registration.manifest")];
|
||||||
registerManifests(manifests);
|
registerManifests(manifests);
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
let newAppInfo = ChromeUtils.import(
|
let newAppInfo = ChromeUtils.import(
|
||||||
"resource://testing-common/AppInfo.jsm",
|
"resource://testing-common/AppInfo.jsm",
|
||||||
|
|
|
||||||
|
|
@ -66,9 +66,7 @@ function run_test() {
|
||||||
platformVersion: "1.9",
|
platformVersion: "1.9",
|
||||||
});
|
});
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
let XULAppInfoFactory = {
|
let XULAppInfoFactory = {
|
||||||
// These two are used when we register all our factories (and unregister)
|
// These two are used when we register all our factories (and unregister)
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { Cc, Ci } = require("chrome");
|
const { Cc, Ci } = require("chrome");
|
||||||
const { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const { generateUUID } = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new `uuid`.
|
* Returns a new `uuid`.
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,7 @@ registerCleanupFunction(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function createFakeAddonWindow({ addonId } = {}) {
|
function createFakeAddonWindow({ addonId } = {}) {
|
||||||
const uuidGen = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGen = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
const uuid = uuidGen.generateUUID().number.slice(1, -1);
|
const uuid = uuidGen.generateUUID().number.slice(1, -1);
|
||||||
|
|
||||||
if (policy) {
|
if (policy) {
|
||||||
|
|
|
||||||
|
|
@ -867,9 +867,7 @@ var PushServiceWebSocket = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_generateID() {
|
_generateID() {
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
// generateUUID() gives a UUID surrounded by {...}, slice them off.
|
// generateUUID() gives a UUID surrounded by {...}, slice them off.
|
||||||
return uuidGenerator
|
return uuidGenerator
|
||||||
.generateUUID()
|
.generateUUID()
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,7 @@ function test() {
|
||||||
|
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
let uuid = uuidGenerator.generateUUID().number;
|
let uuid = uuidGenerator.generateUUID().number;
|
||||||
uuid = uuid.slice(1, -1); // Strip { and } off the UUID.
|
uuid = uuid.slice(1, -1); // Strip { and } off the UUID.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@ var factory = {
|
||||||
QueryInterface: ChromeUtils.generateQI(["nsIFactory"]),
|
QueryInterface: ChromeUtils.generateQI(["nsIFactory"]),
|
||||||
};
|
};
|
||||||
|
|
||||||
var newClassID = Cc["@mozilla.org/uuid-generator;1"]
|
var newClassID = Services.uuid.generateUUID();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID();
|
|
||||||
|
|
||||||
var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
||||||
var oldClassID = registrar.contractIDToCID(CONTRACT_ID);
|
var oldClassID = registrar.contractIDToCID(CONTRACT_ID);
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,7 @@ function log(aMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateUuid() {
|
function generateUuid() {
|
||||||
var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
var uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
return uuidGenerator.generateUUID().toString();
|
return uuidGenerator.generateUUID().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,7 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
const environment = Cc["@mozilla.org/process/environment;1"].getService(
|
const environment = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
Ci.nsIEnvironment
|
Ci.nsIEnvironment
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -513,10 +513,7 @@ var CommonUtils = {
|
||||||
* @return string A hex-formatted UUID string.
|
* @return string A hex-formatted UUID string.
|
||||||
*/
|
*/
|
||||||
generateUUID: function generateUUID() {
|
generateUUID: function generateUUID() {
|
||||||
let uuid = Cc["@mozilla.org/uuid-generator;1"]
|
let uuid = Services.uuid.generateUUID().toString();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
|
||||||
.toString();
|
|
||||||
|
|
||||||
return uuid.substring(1, uuid.length - 1);
|
return uuid.substring(1, uuid.length - 1);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,7 @@ class FxAccountsTelemetry {
|
||||||
}
|
}
|
||||||
|
|
||||||
generateUUID() {
|
generateUUID() {
|
||||||
return Cc["@mozilla.org/uuid-generator;1"]
|
return Services.uuid
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
.generateUUID()
|
||||||
.toString()
|
.toString()
|
||||||
.slice(1, -1);
|
.slice(1, -1);
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,7 @@ var Cm = Components.manager;
|
||||||
|
|
||||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
const { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const { generateUUID } = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
function AboutPage(aboutHost, chromeURL, uriFlags) {
|
function AboutPage(aboutHost, chromeURL, uriFlags) {
|
||||||
this.chromeURL = chromeURL;
|
this.chromeURL = chromeURL;
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
||||||
AppUiTestDelegate: "resource://testing-common/AppUiTestDelegate.jsm",
|
AppUiTestDelegate: "resource://testing-common/AppUiTestDelegate.jsm",
|
||||||
});
|
});
|
||||||
|
|
||||||
const UUIDGen = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const UUIDGen = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
class AppTestDelegateParent extends JSWindowActorParent {
|
class AppTestDelegateParent extends JSWindowActorParent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@ Cu.crashIfNotInAutomation();
|
||||||
|
|
||||||
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||||
var oldClassID = "";
|
var oldClassID = "";
|
||||||
var newClassID = Cc["@mozilla.org/uuid-generator;1"]
|
var newClassID = Services.uuid.generateUUID();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID();
|
|
||||||
var newFactory = function(window) {
|
var newFactory = function(window) {
|
||||||
return {
|
return {
|
||||||
createInstance(aOuter, aIID) {
|
createInstance(aOuter, aIID) {
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,7 @@ if (__URI__.includes("specialpowers")) {
|
||||||
|
|
||||||
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||||
var oldClassID;
|
var oldClassID;
|
||||||
var newClassID = Cc["@mozilla.org/uuid-generator;1"]
|
var newClassID = Services.uuid.generateUUID();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID();
|
|
||||||
var newFactory = function(window) {
|
var newFactory = function(window) {
|
||||||
return {
|
return {
|
||||||
createInstance(aOuter, aIID) {
|
createInstance(aOuter, aIID) {
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,7 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||||
var oldClassID, oldFactory;
|
var oldClassID, oldFactory;
|
||||||
var newClassID = Cc["@mozilla.org/uuid-generator;1"]
|
var newClassID = Services.uuid.generateUUID();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID();
|
|
||||||
var newFactory = {
|
var newFactory = {
|
||||||
createInstance(aOuter, aIID) {
|
createInstance(aOuter, aIID) {
|
||||||
if (aOuter) {
|
if (aOuter) {
|
||||||
|
|
|
||||||
|
|
@ -594,9 +594,7 @@ class SpecialPowersChild extends JSWindowActorChild {
|
||||||
|
|
||||||
loadChromeScript(urlOrFunction, sandboxOptions) {
|
loadChromeScript(urlOrFunction, sandboxOptions) {
|
||||||
// Create a unique id for this chrome script
|
// Create a unique id for this chrome script
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
let id = uuidGenerator.generateUUID().toString();
|
let id = uuidGenerator.generateUUID().toString();
|
||||||
|
|
||||||
// Tells chrome code to evaluate this chrome script
|
// Tells chrome code to evaluate this chrome script
|
||||||
|
|
@ -1784,9 +1782,7 @@ class SpecialPowersChild extends JSWindowActorChild {
|
||||||
if (cid) {
|
if (cid) {
|
||||||
componentRegistrar.unregisterFactory(currentCID, currentFactory);
|
componentRegistrar.unregisterFactory(currentCID, currentFactory);
|
||||||
} else {
|
} else {
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
cid = uuidGenerator.generateUUID();
|
cid = uuidGenerator.generateUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,7 @@ const TEST_PREFLIGHT_PAGE =
|
||||||
"http://example.net/browser/toolkit/components/antitracking/test/browser/browser_staticPartition_CORS_preflight.sjs";
|
"http://example.net/browser/toolkit/components/antitracking/test/browser/browser_staticPartition_CORS_preflight.sjs";
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
for (let networkIsolation of [true, false]) {
|
for (let networkIsolation of [true, false]) {
|
||||||
for (let partitionPerSite of [true, false]) {
|
for (let partitionPerSite of [true, false]) {
|
||||||
|
|
|
||||||
|
|
@ -95,9 +95,7 @@ add_task(async function setup() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function testContextMenuSaveImage() {
|
add_task(async function testContextMenuSaveImage() {
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
for (let networkIsolation of [true, false]) {
|
for (let networkIsolation of [true, false]) {
|
||||||
for (let partitionPerSite of [true, false]) {
|
for (let partitionPerSite of [true, false]) {
|
||||||
|
|
@ -192,9 +190,7 @@ add_task(async function testContextMenuSaveImage() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function testContextMenuSaveVideo() {
|
add_task(async function testContextMenuSaveVideo() {
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
for (let networkIsolation of [true, false]) {
|
for (let networkIsolation of [true, false]) {
|
||||||
for (let partitionPerSite of [true, false]) {
|
for (let partitionPerSite of [true, false]) {
|
||||||
|
|
|
||||||
|
|
@ -176,9 +176,7 @@ AutocompletePopupBase.prototype = {
|
||||||
*/
|
*/
|
||||||
function registerAutoCompleteSearch(aSearch) {
|
function registerAutoCompleteSearch(aSearch) {
|
||||||
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
||||||
var cid = Cc["@mozilla.org/uuid-generator;1"]
|
var cid = Services.uuid.generateUUID();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID();
|
|
||||||
|
|
||||||
var desc = "Test AutoCompleteSearch";
|
var desc = "Test AutoCompleteSearch";
|
||||||
var componentManager = Components.manager.QueryInterface(
|
var componentManager = Components.manager.QueryInterface(
|
||||||
|
|
|
||||||
|
|
@ -162,9 +162,7 @@ AutoCompleteSearch.prototype = {
|
||||||
function registerAutoCompleteSearch(aSearch) {
|
function registerAutoCompleteSearch(aSearch) {
|
||||||
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
||||||
|
|
||||||
var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
var uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
var cid = uuidGenerator.generateUUID();
|
var cid = uuidGenerator.generateUUID();
|
||||||
|
|
||||||
var desc = "Test AutoCompleteSearch";
|
var desc = "Test AutoCompleteSearch";
|
||||||
|
|
|
||||||
|
|
@ -161,9 +161,7 @@ AutoCompleteSearch.prototype = {
|
||||||
function registerAutoCompleteSearch(aSearch) {
|
function registerAutoCompleteSearch(aSearch) {
|
||||||
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
||||||
|
|
||||||
var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
var uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
var cid = uuidGenerator.generateUUID();
|
var cid = uuidGenerator.generateUUID();
|
||||||
|
|
||||||
var desc = "Test AutoCompleteSearch";
|
var desc = "Test AutoCompleteSearch";
|
||||||
|
|
|
||||||
|
|
@ -160,9 +160,7 @@ AutoCompleteSearch.prototype = {
|
||||||
function registerAutoCompleteSearch(aSearch) {
|
function registerAutoCompleteSearch(aSearch) {
|
||||||
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
||||||
|
|
||||||
var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
var uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
var cid = uuidGenerator.generateUUID();
|
var cid = uuidGenerator.generateUUID();
|
||||||
|
|
||||||
var desc = "Test AutoCompleteSearch";
|
var desc = "Test AutoCompleteSearch";
|
||||||
|
|
|
||||||
|
|
@ -164,9 +164,7 @@ AutoCompleteSearch.prototype = {
|
||||||
function registerAutoCompleteSearch(aSearch) {
|
function registerAutoCompleteSearch(aSearch) {
|
||||||
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
||||||
|
|
||||||
var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
var uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
var cid = uuidGenerator.generateUUID();
|
var cid = uuidGenerator.generateUUID();
|
||||||
|
|
||||||
var desc = "Test AutoCompleteSearch";
|
var desc = "Test AutoCompleteSearch";
|
||||||
|
|
|
||||||
|
|
@ -164,9 +164,7 @@ AutoCompleteSearch.prototype = {
|
||||||
function registerAutoCompleteSearch(aSearch) {
|
function registerAutoCompleteSearch(aSearch) {
|
||||||
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
||||||
|
|
||||||
var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
var uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
var cid = uuidGenerator.generateUUID();
|
var cid = uuidGenerator.generateUUID();
|
||||||
|
|
||||||
var desc = "Test AutoCompleteSearch";
|
var desc = "Test AutoCompleteSearch";
|
||||||
|
|
|
||||||
|
|
@ -83,9 +83,7 @@ AutoCompleteSearch.prototype = {
|
||||||
*/
|
*/
|
||||||
function registerAutoCompleteSearch(aSearch) {
|
function registerAutoCompleteSearch(aSearch) {
|
||||||
let name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
let name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
let cid = uuidGenerator.generateUUID();
|
let cid = uuidGenerator.generateUUID();
|
||||||
let desc = "Test AutoCompleteSearch";
|
let desc = "Test AutoCompleteSearch";
|
||||||
let componentManager = Components.manager.QueryInterface(
|
let componentManager = Components.manager.QueryInterface(
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
add_task(async function test_backgroundtask_deletes_profile() {
|
add_task(async function test_backgroundtask_deletes_profile() {
|
||||||
let sentinel = Cc["@mozilla.org/uuid-generator;1"]
|
let sentinel = Services.uuid.generateUUID().toString();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
|
||||||
.toString();
|
|
||||||
sentinel = sentinel.substring(1, sentinel.length - 1);
|
sentinel = sentinel.substring(1, sentinel.length - 1);
|
||||||
|
|
||||||
let stdoutLines = [];
|
let stdoutLines = [];
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,7 @@
|
||||||
// launched background task, etc. This is an easy way to ensure that tasks are running concurrently
|
// launched background task, etc. This is an easy way to ensure that tasks are running concurrently
|
||||||
// without requiring concurrency primitives.
|
// without requiring concurrency primitives.
|
||||||
add_task(async function test_backgroundtask_unique_profile() {
|
add_task(async function test_backgroundtask_unique_profile() {
|
||||||
let sentinel = Cc["@mozilla.org/uuid-generator;1"]
|
let sentinel = Services.uuid.generateUUID().toString();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
|
||||||
.toString();
|
|
||||||
sentinel = sentinel.substring(1, sentinel.length - 1);
|
sentinel = sentinel.substring(1, sentinel.length - 1);
|
||||||
|
|
||||||
let count = 3;
|
let count = 3;
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,7 @@ const { SiteDataTestUtils } = ChromeUtils.import(
|
||||||
"resource://testing-common/SiteDataTestUtils.jsm"
|
"resource://testing-common/SiteDataTestUtils.jsm"
|
||||||
);
|
);
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
const ORIGIN_A = "http://example.net";
|
const ORIGIN_A = "http://example.net";
|
||||||
const ORIGIN_B = "http://example.org";
|
const ORIGIN_B = "http://example.org";
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,7 @@ class ContentPrefsChild extends JSProcessActorChild {
|
||||||
}
|
}
|
||||||
|
|
||||||
_getRandomId() {
|
_getRandomId() {
|
||||||
return Cc["@mozilla.org/uuid-generator;1"]
|
return Services.uuid.generateUUID().toString();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
receiveMessage(msg) {
|
receiveMessage(msg) {
|
||||||
|
|
|
||||||
|
|
@ -529,8 +529,7 @@ CrashManager.prototype = Object.freeze({
|
||||||
generateSubmissionID() {
|
generateSubmissionID() {
|
||||||
return (
|
return (
|
||||||
"sub-" +
|
"sub-" +
|
||||||
Cc["@mozilla.org/uuid-generator;1"]
|
Services.uuid
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
.generateUUID()
|
||||||
.toString()
|
.toString()
|
||||||
.slice(1, -1)
|
.slice(1, -1)
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,7 @@ TestingCrashManager.prototype = {
|
||||||
__proto__: CrashManager.prototype,
|
__proto__: CrashManager.prototype,
|
||||||
|
|
||||||
createDummyDump(submitted = false, date = new Date(), hr = false) {
|
createDummyDump(submitted = false, date = new Date(), hr = false) {
|
||||||
let uuid = Cc["@mozilla.org/uuid-generator;1"]
|
let uuid = Services.uuid.generateUUID().toString();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
|
||||||
.toString();
|
|
||||||
uuid = uuid.substring(1, uuid.length - 1);
|
uuid = uuid.substring(1, uuid.length - 1);
|
||||||
|
|
||||||
let path;
|
let path;
|
||||||
|
|
|
||||||
|
|
@ -497,9 +497,7 @@ class CryptoCollection {
|
||||||
// This is a new keyring. Invent an ID for this record. If this
|
// This is a new keyring. Invent an ID for this record. If this
|
||||||
// changes, it means a client replaced the keyring, so we need to
|
// changes, it means a client replaced the keyring, so we need to
|
||||||
// reupload everything.
|
// reupload everything.
|
||||||
const uuidgen = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidgen = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
const uuid = uuidgen.generateUUID().toString();
|
const uuid = uuidgen.generateUUID().toString();
|
||||||
data = { uuid, id: STORAGE_SYNC_CRYPTO_KEYRING_RECORD_ID };
|
data = { uuid, id: STORAGE_SYNC_CRYPTO_KEYRING_RECORD_ID };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
const Cm = Components.manager;
|
const Cm = Components.manager;
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
var mockNetworkStatusService = {
|
var mockNetworkStatusService = {
|
||||||
contractId: "@mozilla.org/network/network-link-service;1",
|
contractId: "@mozilla.org/network/network-link-service;1",
|
||||||
|
|
|
||||||
|
|
@ -649,9 +649,7 @@ const loggedInUser = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function uuid() {
|
function uuid() {
|
||||||
const uuidgen = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidgen = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
return uuidgen.generateUUID().toString();
|
return uuidgen.generateUUID().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1166,12 +1166,7 @@ class ModalPrompter {
|
||||||
// It is technically possible for multiple prompts to be sent from a single
|
// It is technically possible for multiple prompts to be sent from a single
|
||||||
// BrowsingContext. See bug 1266353. We use a randomly generated UUID to
|
// BrowsingContext. See bug 1266353. We use a randomly generated UUID to
|
||||||
// differentiate between the different prompts.
|
// differentiate between the different prompts.
|
||||||
let id =
|
let id = "id" + Services.uuid.generateUUID().toString();
|
||||||
"id" +
|
|
||||||
Cc["@mozilla.org/uuid-generator;1"]
|
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
|
||||||
.toString();
|
|
||||||
|
|
||||||
args._remoteId = id;
|
args._remoteId = id;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,7 @@ function getFirefoxExecutableFile() {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
function randomName() {
|
function randomName() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ const WinSvc = Cc["@mozilla.org/win-task-scheduler-service;1"].getService(
|
||||||
Ci.nsIWinTaskSchedulerService
|
Ci.nsIWinTaskSchedulerService
|
||||||
);
|
);
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
function randomName() {
|
function randomName() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,7 @@ const svc = Cc["@mozilla.org/win-task-scheduler-service;1"].getService(
|
||||||
Ci.nsIWinTaskSchedulerService
|
Ci.nsIWinTaskSchedulerService
|
||||||
);
|
);
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
function randomName() {
|
function randomName() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -207,10 +207,7 @@ var TelemetryUtils = {
|
||||||
},
|
},
|
||||||
|
|
||||||
generateUUID() {
|
generateUUID() {
|
||||||
let str = Cc["@mozilla.org/uuid-generator;1"]
|
let str = Services.uuid.generateUUID().toString();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
|
||||||
.toString();
|
|
||||||
// strip {}
|
// strip {}
|
||||||
return str.substring(1, str.length - 1);
|
return str.substring(1, str.length - 1);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -68,10 +68,7 @@ XPCOMUtils.defineLazyServiceGetters(this, {
|
||||||
});
|
});
|
||||||
|
|
||||||
function generateUUID() {
|
function generateUUID() {
|
||||||
let str = Cc["@mozilla.org/uuid-generator;1"]
|
let str = Services.uuid.generateUUID().toString();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID()
|
|
||||||
.toString();
|
|
||||||
// strip {}
|
// strip {}
|
||||||
return str.substring(1, str.length - 1);
|
return str.substring(1, str.length - 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,7 @@ function create_subdir(dir, subdirname) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate_uuid() {
|
function generate_uuid() {
|
||||||
let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
let uuid = uuidGenerator.generateUUID().toString();
|
let uuid = uuidGenerator.generateUUID().toString();
|
||||||
// ditch the {}
|
// ditch the {}
|
||||||
return uuid.substring(1, uuid.length - 1);
|
return uuid.substring(1, uuid.length - 1);
|
||||||
|
|
|
||||||
|
|
@ -1199,9 +1199,7 @@ async function mockGfxBlocklistItemsFromDisk(path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function mockGfxBlocklistItems(items) {
|
async function mockGfxBlocklistItems(items) {
|
||||||
const { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const { generateUUID } = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
let bsPass = ChromeUtils.import("resource://gre/modules/Blocklist.jsm", null);
|
let bsPass = ChromeUtils.import("resource://gre/modules/Blocklist.jsm", null);
|
||||||
const client = RemoteSettings(
|
const client = RemoteSettings(
|
||||||
Services.prefs.getCharPref("services.blocklist.gfx.collection"),
|
Services.prefs.getCharPref("services.blocklist.gfx.collection"),
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,7 @@ registerDirectory("XREAppFeat", distroDir);
|
||||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "0");
|
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "0");
|
||||||
|
|
||||||
function makeUUID() {
|
function makeUUID() {
|
||||||
let uuidGen = Cc["@mozilla.org/uuid-generator;1"].getService(
|
let uuidGen = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
return uuidGen.generateUUID().toString();
|
return uuidGen.generateUUID().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,7 @@ Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
|
||||||
var testserver = createHttpServer();
|
var testserver = createHttpServer();
|
||||||
gPort = testserver.identity.primaryPort;
|
gPort = testserver.identity.primaryPort;
|
||||||
|
|
||||||
const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
const uuidGenerator = Services.uuid;
|
||||||
Ci.nsIUUIDGenerator
|
|
||||||
);
|
|
||||||
|
|
||||||
const extensionsDir = gProfD.clone();
|
const extensionsDir = gProfD.clone();
|
||||||
extensionsDir.append("extensions");
|
extensionsDir.append("extensions");
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,7 @@ const HELPERAPP_DIALOG_CID = Components.ID(
|
||||||
Cc[HELPERAPP_DIALOG_CONTRACT].number
|
Cc[HELPERAPP_DIALOG_CONTRACT].number
|
||||||
);
|
);
|
||||||
|
|
||||||
const FAKE_CID = Cc["@mozilla.org/uuid-generator;1"]
|
const FAKE_CID = Services.uuid.generateUUID();
|
||||||
.getService(Ci.nsIUUIDGenerator)
|
|
||||||
.generateUUID();
|
|
||||||
/* eslint-env mozilla/frame-script */
|
/* eslint-env mozilla/frame-script */
|
||||||
function HelperAppLauncherDialog() {}
|
function HelperAppLauncherDialog() {}
|
||||||
HelperAppLauncherDialog.prototype = {
|
HelperAppLauncherDialog.prototype = {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue