mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1652000 - A little lifetime documentation;r=nika
Differential Revision: https://phabricator.services.mozilla.com/D83337
This commit is contained in:
parent
23a82b7187
commit
94b50d3de1
@ -800,6 +800,8 @@ already_AddRefed<Promise> ChromeUtils::RequestProcInfo(GlobalObject& aGlobal,
|
||||
// Get all the content parents.
|
||||
// Note that this array includes even the long dead content parents, so we
|
||||
// might have some garbage, especially with Fission.
|
||||
// SAFETY NOTE: `contentParents` is only valid if used synchronously.
|
||||
// Anything else and you may end up dealing with dangling pointers.
|
||||
nsTArray<ContentParent*> contentParents;
|
||||
ContentParent::GetAll(contentParents);
|
||||
|
||||
|
@ -238,6 +238,16 @@ class ContentParent final
|
||||
const nsACString& aRemoteType, BrowsingContext* aBrowsingContext,
|
||||
ContentParent* aOpenerContentParent);
|
||||
|
||||
/**
|
||||
* Get all content parents.
|
||||
*
|
||||
* # Lifetime
|
||||
*
|
||||
* These pointers are ONLY valid for synchronous use from the main thread.
|
||||
*
|
||||
* Do NOT attempt to use them after the main thread has had a chance to handle
|
||||
* messages or you could end up with dangling pointers.
|
||||
*/
|
||||
static void GetAll(nsTArray<ContentParent*>& aArray);
|
||||
|
||||
static void GetAllEvenIfDead(nsTArray<ContentParent*>& aArray);
|
||||
|
@ -180,6 +180,8 @@ class GeckoChildProcessHost : public ChildProcessHost,
|
||||
// Iterates over all instances and calls aCallback with each one of them.
|
||||
// This method will lock any addition/removal of new processes
|
||||
// so you need to make sure the callback is as fast as possible.
|
||||
//
|
||||
// To reiterate: the callbacks are executed synchronously.
|
||||
static void GetAll(const GeckoProcessCallback& aCallback);
|
||||
|
||||
friend class BaseProcessLauncher;
|
||||
|
Loading…
Reference in New Issue
Block a user