Open
Bug 1386441
Opened 7 years ago
Updated 2 years ago
Address common need of PBackground-managed services to retrieve NS_APP_USER_PROFILE_50_DIR/"ProfD" from directory service
Categories
(Core :: IPC, enhancement, P3)
Core
IPC
Tracking
()
NEW
People
(Reporter: asuth, Unassigned)
References
Details
It's a pretty common need to know the profile directory, but nsDirectoryService can only safely be accessed from the main thread. This stems from its use of a non-threadsafe hashtable and that it's very common for tests to implement nsIDirectoryServiceProviders in JS which may need to be consulted.
Bug 1350637 is moving LocalStorage from PContent to PBackground and is currently addressing this problem by blocking the background thread while it dispatches a runnable to the main thread. This is an unfortunate side-effect of the `sync Preload` IPDL method. Other services are able to do this asynchronously, (ex: QuotaManager::CreateRunnable) and may have other main thread-actions they need to undertake, but I think it's worth thinking about letting PBackground-based services avoid potentially avoidable main-thread bounces, blocking or not.
PS: LocalStorage also uses the runnable to ensure the mozStorage service is initialized. That's another example of something common that logic off-the-main-thread should ideally be able to assume is available.
Comment 1•7 years ago
|
||
Yeah, agreed.
Comment 2•7 years ago
|
||
I think this should be in toolkit, but we'll keep it here for now.
Priority: -- → P3
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•