Bug 1133594 - Hide nsFrameMessageManager::sChildProcessManager (r=smaug)

This commit is contained in:
Bill McCloskey 2015-02-19 17:12:38 -08:00
parent 8be91d88a2
commit b4be4f4b11
5 changed files with 12 additions and 8 deletions

View File

@ -169,8 +169,8 @@ MarkMessageManagers()
if (nsFrameMessageManager::sSameProcessParentManager) {
nsFrameMessageManager::sSameProcessParentManager->MarkForCC();
}
if (nsFrameMessageManager::sChildProcessManager) {
nsFrameMessageManager::sChildProcessManager->MarkForCC();
if (nsFrameMessageManager::GetChildProcessManager()) {
nsFrameMessageManager::GetChildProcessManager()->MarkForCC();
}
}

View File

@ -1656,7 +1656,7 @@ public:
NS_IMETHOD Run()
{
nsFrameMessageManager* ppm = nsFrameMessageManager::sChildProcessManager;
nsFrameMessageManager* ppm = nsFrameMessageManager::GetChildProcessManager();
ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(ppm), ppm);
return NS_OK;
}
@ -1920,7 +1920,7 @@ nsFrameMessageManager::NewProcessMessageManager(mozilla::dom::nsIContentParent*
nsresult
NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult)
{
NS_ASSERTION(!nsFrameMessageManager::sChildProcessManager,
NS_ASSERTION(!nsFrameMessageManager::GetChildProcessManager(),
"Re-creating sChildProcessManager");
MessageManagerCallback* cb;
@ -1933,7 +1933,7 @@ NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult)
nsFrameMessageManager* mm = new nsFrameMessageManager(cb,
nullptr,
MM_PROCESSMANAGER | MM_OWNSCALLBACK);
nsFrameMessageManager::sChildProcessManager = mm;
nsFrameMessageManager::SetChildProcessManager(mm);
return CallQueryInterface(mm, aResult);
}

View File

@ -274,6 +274,10 @@ public:
{
return sChildProcessManager;
}
static void SetChildProcessManager(nsFrameMessageManager* aManager)
{
sChildProcessManager = aManager;
}
private:
nsresult SendMessage(const nsAString& aMessageName,
JS::Handle<JS::Value> aJSON,
@ -307,10 +311,10 @@ protected:
nsFrameMessageManager* aChildMM);
public:
static nsFrameMessageManager* sParentProcessManager;
static nsFrameMessageManager* sChildProcessManager;
static nsFrameMessageManager* sSameProcessParentManager;
static nsTArray<nsCOMPtr<nsIRunnable> >* sPendingSameProcessAsyncMessages;
private:
static nsFrameMessageManager* sChildProcessManager;
enum ProcessCheckerType {
PROCESS_CHECKER_PERMISSION,
PROCESS_CHECKER_MANIFEST_URL,

View File

@ -1919,7 +1919,7 @@ ContentChild::RecvAsyncMessage(const nsString& aMsg,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal)
{
nsRefPtr<nsFrameMessageManager> cpm = nsFrameMessageManager::sChildProcessManager;
nsRefPtr<nsFrameMessageManager> cpm = nsFrameMessageManager::GetChildProcessManager();
if (cpm) {
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForChild(aData);
CrossProcessCpowHolder cpows(this, aCpows);

View File

@ -113,7 +113,7 @@ nsIContentChild::RecvAsyncMessage(const nsString& aMsg,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal)
{
nsRefPtr<nsFrameMessageManager> cpm = nsFrameMessageManager::sChildProcessManager;
nsRefPtr<nsFrameMessageManager> cpm = nsFrameMessageManager::GetChildProcessManager();
if (cpm) {
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForChild(aData);
CrossProcessCpowHolder cpows(this, aCpows);