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.
nsPromptServic e::DoDialog( nsIDOMWindow *aParent,
- nsIDialogParamBlock *aParamBlock, const char *aChromeURL)
+ nsIDialogParamBlock *aParamBlock, const char *aChromeURL,
+ void **aAggregator)
I'd rename new parameter aAggregator to something like tonTracker
aPromptSingle
I'd rename WaitAndGrab to something like SingletonWaitAn dGrab, 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? Aggregator and mUserAndPasswor dPromptAggregat or aren't just pointers, but each would have to be an object containing a lock and the pointer.
You don't have synchronization objects (mutex/lock) that would prevent it.
This would probably require that your mPasswordPrompt
Or maybe, even better, make PromptAggregator an object containing a lock, create two instances for your 2 singleton trackers.
typo "neccesarry" => necessary