Bug 845668 Part 1: Remove nsFrameMessageManager::IsChromeProcess r=smaug

This commit is contained in:
David Zbarsky 2013-06-14 23:40:22 -07:00
parent 2a312ab4db
commit bad7d32b05

View File

@ -44,19 +44,6 @@ using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::dom::ipc;
static bool
IsChromeProcess()
{
nsCOMPtr<nsIXULRuntime> rt = do_GetService("@mozilla.org/xre/runtime;1");
if (!rt)
return true;
uint32_t type;
rt->GetProcessType(&type);
return type == nsIXULRuntime::PROCESS_TYPE_DEFAULT;
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsFrameMessageManager)
uint32_t count = tmp->mListeners.Length();
for (uint32_t i = 0; i < count; i++) {
@ -836,7 +823,8 @@ nsFrameMessageManager::Disconnect(bool aRemoveFromParent)
nsresult
NS_NewGlobalMessageManager(nsIMessageBroadcaster** aResult)
{
NS_ENSURE_TRUE(IsChromeProcess(), NS_ERROR_NOT_AVAILABLE);
NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default,
NS_ERROR_NOT_AVAILABLE);
nsFrameMessageManager* mm = new nsFrameMessageManager(nullptr,
nullptr,
nullptr,
@ -1387,7 +1375,8 @@ NS_NewParentProcessMessageManager(nsIMessageBroadcaster** aResult)
{
NS_ASSERTION(!nsFrameMessageManager::sParentProcessManager,
"Re-creating sParentProcessManager");
NS_ENSURE_TRUE(IsChromeProcess(), NS_ERROR_NOT_AVAILABLE);
NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default,
NS_ERROR_NOT_AVAILABLE);
nsRefPtr<nsFrameMessageManager> mm = new nsFrameMessageManager(nullptr,
nullptr,
nullptr,
@ -1432,7 +1421,7 @@ NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult)
"Re-creating sChildProcessManager");
MessageManagerCallback* cb;
if (IsChromeProcess()) {
if (XRE_GetProcessType() == GeckoProcessType_Default) {
cb = new SameChildProcessMessageManagerCallback();
} else {
cb = new ChildProcessMessageManagerCallback();