Merge missed nsChromeRegistry change from m-c and fix busted content-process XPCOM/chromium event loop.

This commit is contained in:
Chris Jones 2010-05-14 01:41:14 -05:00
parent 58d5c92c00
commit 2877589e40
3 changed files with 15 additions and 3 deletions

View File

@ -198,7 +198,7 @@ nsChromeRegistryChrome::Init()
}
}
nsCOMPtr<nsIObserverService> obsService (do_GetService("@mozilla.org/observer-service;1"));
nsCOMPtr<nsIObserverService> obsService = mozilla::services::GetObserverService();
if (obsService) {
obsService->AddObserver(this, "command-line-startup", PR_TRUE);
obsService->AddObserver(this, "profile-initial-state", PR_TRUE);

View File

@ -442,7 +442,8 @@ class MessageLoopForUI : public MessageLoop {
#ifdef CHROMIUM_MOZILLA_BUILD
Type type = loop->type();
DCHECK(type == MessageLoop::TYPE_UI ||
type == MessageLoop::TYPE_MOZILLA_UI);
type == MessageLoop::TYPE_MOZILLA_UI ||
type == MessageLoop::TYPE_MOZILLA_CHILD);
#else
DCHECK_EQ(MessageLoop::TYPE_UI, loop->type());
#endif

View File

@ -347,8 +347,19 @@ XRE_InitChildProcess(int aArgc,
return NS_ERROR_FAILURE;
}
MessageLoop::Type uiLoopType;
switch (aProcess) {
case GeckoProcessType_Content:
// Content processes need the XPCOM/chromium frankenventloop
uiLoopType = MessageLoop::TYPE_MOZILLA_CHILD;
break;
default:
uiLoopType = MessageLoop::TYPE_UI;
break;
}
// Associate this thread with a UI MessageLoop
MessageLoopForUI uiMessageLoop;
MessageLoop uiMessageLoop(uiLoopType);
{
nsAutoPtr<ProcessChild> process;