Comment 295 for bug 195698

Revision history for this message
In , Kai Engert (kaie) wrote :

 nsPromptService::DoDialog(nsIDOMWindow *aParent,
- nsIDialogParamBlock *aParamBlock, const char *aChromeURL)
+ nsIDialogParamBlock *aParamBlock, const char *aChromeURL,
+ void **aAggregator)

I'd rename new parameter aAggregator to something like
  aPromptSingletonTracker

I'd rename WaitAndGrab to something like SingletonWaitAndGrab, because you don't wait (and don't grab) if the current prompt is not a singleton prompt (no singleton tracker was provided).

Could it happen that you two threads "race" for the same prompt to get opened?
You don't have synchronization objects (mutex/lock) that would prevent it.
This would probably require that your mPasswordPromptAggregator and mUserAndPasswordPromptAggregator aren't just pointers, but each would have to be an object containing a lock and the pointer.

Or maybe, even better, make PromptAggregator an object containing a lock, create two instances for your 2 singleton trackers.

typo "neccesarry" => necessary