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