Improuve fiability of the unique number generation for the session ID

This commit is contained in:
ducarroz%netscape.com 1999-05-11 21:29:50 +00:00
parent 46a75080ad
commit 8fa271cecf
2 changed files with 2 additions and 7 deletions

View File

@ -30,10 +30,8 @@ function ComposeStartup()
var args = GetArgs();
// Generate a unique number, do we have a better way?
// I don't think so a user can create two message compositions
// in the same millisecond!!
var date = new Date();
sessionID = date.getTime();
sessionID = date.getTime() + Math.random();
appCoreName = "EditorAppCore:" + sessionID;
editorAppCore = XPAppCoresManager.Find(appCoreName);
@ -56,7 +54,6 @@ function ComposeStartup()
editorName = appCoreName; //Very important to set this variable used by Editor js
// setEditorType MUST be call before setContentWindow
dump("args.editorType.toLowerCase(): " + args.editorType.toLowerCase() + "\n");
if (args.editorType && args.editorType.toLowerCase() == "html")
{
editorAppCore.setEditorType("html");

View File

@ -28,10 +28,8 @@ function ComposeMessage(tree, nodeList, msgAppCore, type)
dump("\nComposeMessage from XUL\n");
// Generate a unique number, do we have a better way?
// I don't think so a user can create two message compositions
// in the same millisecond!!
var date = new Date();
sessionID = date.getTime();
sessionID = date.getTime() + Math.random();
var composeAppCoreName = "ComposeAppCore:" + sessionID;
var composeAppCore = XPAppCoresManager.Find(composeAppCoreName);