Bug 582032 - Part 1 - Adds a start method to nsIXULRuntime. r=cjones

--HG--
extra : rebase_source : 6e4e6dde727ecfc37393dbd73c3233e6c3c80a2e
This commit is contained in:
Doug Turner 2010-07-30 11:43:56 -07:00
Родитель 9ab6317130
Коммит 63292100e5
2 изменённых файлов: 27 добавлений и 1 удалений

Просмотреть файл

@ -41,6 +41,11 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "mozilla/dom/ContentParent.h"
using mozilla::dom::ContentParent;
#endif
#if defined(XP_OS2) && defined(MOZ_OS2_HIGH_MEMORY)
// os2safe.h has to be included before os2.h, needed for high mem
#include <os2safe.h>
@ -763,6 +768,18 @@ nsXULAppInfo::GetProcessType(PRUint32* aResult)
return NS_OK;
}
NS_IMETHODIMP
nsXULAppInfo::EnsureContentProcess()
{
if (XRE_GetProcessType() != GeckoProcessType_Default)
return NS_ERROR_NOT_AVAILABLE;
ContentParent* c = ContentParent::GetSingleton();
if (!c)
return NS_ERROR_NOT_AVAILABLE;
return NS_OK;
}
NS_IMETHODIMP
nsXULAppInfo::InvalidateCachesOnRestart()
{

Просмотреть файл

@ -44,7 +44,7 @@
* stable/frozen, please contact Benjamin Smedberg.
*/
[scriptable, uuid(cb6078bb-c6b3-4f35-acfd-3b4efa934484)]
[scriptable, uuid(7685dac8-3637-4660-a544-928c5ec0e714)]
interface nsIXULRuntime : nsISupports
{
/**
@ -107,4 +107,13 @@ interface nsIXULRuntime : nsISupports
* fastload data to be re-created.
*/
void invalidateCachesOnRestart();
/**
* Starts a child process. This method is intented to pre-start a
* content child process so that when it is actually needed, it is
* ready to go.
*
* @throw NS_ERROR_NOT_AVAILABLE if not available.
*/
void ensureContentProcess();
};