mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-24 05:44:10 +00:00
Improuve fiability of the unique number generation for the session ID
This commit is contained in:
parent
46a75080ad
commit
8fa271cecf
@ -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");
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user