Bug 927038 - Using nsIUUIDGenerator rather than Date.now(). r=mbrubeck

This commit is contained in:
Kamil Jozwiak 2013-11-07 23:18:06 -05:00
parent 7fc84d38a3
commit 1d5ba8c322

View File

@ -9,6 +9,9 @@ let Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "gUUIDGenerator",
"@mozilla.org/uuid-generator;1", "nsIUUIDGenerator");
let WebProgressListener = {
_lastLocation: null,
_firstPaint: false,
@ -260,7 +263,7 @@ let WebNavigation = {
// start might already be in use)
let id = aIdMap[aEntry.ID] || 0;
if (!id) {
for (id = Date.now(); id in aIdMap.used; id++);
id = gUUIDGenerator.generateUUID();
aIdMap[aEntry.ID] = id;
aIdMap.used[id] = true;
}