mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1020186 - Patch1: Revise the API in ContentProcessManager - v1, r=khuey
This commit is contained in:
parent
7f42025e12
commit
a5dd5a415d
@ -207,25 +207,29 @@ ContentProcessManager::DeallocateTabId(const ContentParentId& aChildCpId,
|
||||
}
|
||||
}
|
||||
|
||||
nsTArray<uint64_t>
|
||||
ContentProcessManager::GetAppIdsByContentProcess(const ContentParentId& aChildCpId)
|
||||
bool
|
||||
ContentProcessManager::GetTabContextByProcessAndTabId(const ContentParentId& aChildCpId,
|
||||
const TabId& aChildTabId,
|
||||
/*out*/ TabContext* aTabContext)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aTabContext);
|
||||
|
||||
nsTArray<uint64_t> appIdArray;
|
||||
auto iter = mContentParentMap.find(aChildCpId);
|
||||
if (NS_WARN_IF(iter == mContentParentMap.end())) {
|
||||
ASSERT_UNLESS_FUZZING();
|
||||
return Move(appIdArray);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto remoteFrameIter = iter->second.mRemoteFrames.begin();
|
||||
remoteFrameIter != iter->second.mRemoteFrames.end();
|
||||
++remoteFrameIter) {
|
||||
appIdArray.AppendElement(remoteFrameIter->second.mContext.OwnOrContainingAppId());
|
||||
auto remoteFrameIter = iter->second.mRemoteFrames.find(aChildTabId);
|
||||
if (NS_WARN_IF(remoteFrameIter == iter->second.mRemoteFrames.end())) {
|
||||
ASSERT_UNLESS_FUZZING();
|
||||
return false;
|
||||
}
|
||||
|
||||
return Move(appIdArray);
|
||||
*aTabContext = remoteFrameIter->second.mContext;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
nsTArray<TabContext>
|
||||
|
@ -88,11 +88,12 @@ public:
|
||||
const TabId& aChildTabId);
|
||||
|
||||
/**
|
||||
* Get all app ids which are inside the given content process.
|
||||
* XXX Currently not used. Plan to be used for bug 1020186.
|
||||
* Get the TabContext by the given content process and tab id.
|
||||
*/
|
||||
nsTArray<uint64_t>
|
||||
GetAppIdsByContentProcess(const ContentParentId& aChildCpId);
|
||||
bool
|
||||
GetTabContextByProcessAndTabId(const ContentParentId& aChildCpId,
|
||||
const TabId& aChildTabId,
|
||||
/*out*/ TabContext* aTabContext);
|
||||
|
||||
/**
|
||||
* Get all TabContext which are inside the given content process.
|
||||
|
Loading…
Reference in New Issue
Block a user