Here's kind of an interesting idea - what if the per-instance
application data got a special key, as generated by the embeddor - and
then the embeddor could determine if they want it to be per-process or
per-installation, and optionally insert their PID into this special key
For instance, if Embeddor1 only expects one instance of itself, but
Embeddor2 expects 2 instances, then Embeddor1 would ask for the "cache
directory for Embeddor1" but Embeddor2 could ask for the "cache
directory for Embeddor2-4913" - that way the embeddors would understand
that if they ARE doing multiple instances, then they need to do stuff on
a per-PID basis, and thus they'll understand that they'll get different
cache directories, and so forth.
Also, what about extending nsIDirectoryService (i.e.
nsIDirectoryService2 or something) to be able to set this key, and then
to allow file providers to specify if they need per-profile or
per-embeddor files.
interface nsIDirectoryService2 : nsIDirectoryService {
// include your PID in this if you expect multiple instances
attribute string instanceKey;
};
then it could be up to the provider to get the key and return an
instance-specific file. They would use
nsIDirectoryService2::GetInstanceKey to get any per-instance directory
name..
Alec