Bug 1114507 - Part 1: Add/release the appId's refcnt if frame is in main process. r=kanru

This commit is contained in:
chunminchang 2015-08-20 23:38:00 -04:00
parent db2063db14
commit 3c2040e20d

View File

@ -157,7 +157,6 @@ nsFrameLoader::nsFrameLoader(Element* aOwner, bool aNetworkCreated)
, mObservingOwnerContent(false)
, mVisible(true)
{
ResetPermissionManagerStatus();
mRemoteFrame = ShouldUseRemoteProcess();
}
@ -409,6 +408,9 @@ nsFrameLoader::ReallyStartLoadingInternal()
mURIToLoad = nullptr;
NS_ENSURE_SUCCESS(rv, rv);
// Track the appId's reference count if this frame is in-process
ResetPermissionManagerStatus();
return NS_OK;
}
@ -2705,7 +2707,9 @@ nsFrameLoader::ResetPermissionManagerStatus()
{
// The resetting of the permissions status can run only
// in the main process.
if (XRE_IsContentProcess()) {
// only in-main-process && in-process frame is handled here and all other
// cases are handled by ContentParent.
if (XRE_IsContentProcess() || mRemoteFrame) {
return;
}