зеркало из https://github.com/mozilla/gecko-dev.git
NOT PART OF BUILD. Created variant of NS_InitEmbedding that accepts an nsILocalFile object as a parameter
This commit is contained in:
Родитель
ba1d4cc898
Коммит
7987d5a2ce
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsIEventQueueService.h"
|
||||
|
||||
#include "nsIStringBundle.h"
|
||||
|
@ -68,7 +67,24 @@ extern "C" void NS_SetupRegistry();
|
|||
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||
static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||
|
||||
|
||||
nsresult NS_InitEmbedding(const char *aPath)
|
||||
{
|
||||
// Create an object to represent the path
|
||||
nsILocalFile *localFile = nsnull;
|
||||
if (aPath && strlen(aPath) > 0)
|
||||
{
|
||||
NS_NewLocalFile(aPath, &localFile);
|
||||
}
|
||||
|
||||
nsresult rv = NS_InitEmbedding(localFile);
|
||||
NS_IF_RELEASE(localFile);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
nsresult NS_InitEmbedding(nsILocalFile *aPath)
|
||||
{
|
||||
// Reentrant calls to this method do nothing except increment a counter
|
||||
if (++sInitCounter > 1)
|
||||
|
@ -82,18 +98,10 @@ nsresult NS_InitEmbedding(const char *aPath)
|
|||
if (!sXPCOMInitializedFlag)
|
||||
#endif
|
||||
{
|
||||
// Create an object to represent the path
|
||||
nsILocalFile *pBinDirPath = nsnull;
|
||||
if (aPath && strlen(aPath) > 0)
|
||||
{
|
||||
NS_NewLocalFile(aPath, &pBinDirPath);
|
||||
}
|
||||
|
||||
// Initialise XPCOM
|
||||
if (pBinDirPath)
|
||||
if (aPath)
|
||||
{
|
||||
NS_InitXPCOM(&sServiceManager, pBinDirPath);
|
||||
NS_RELEASE(pBinDirPath);
|
||||
NS_InitXPCOM(&sServiceManager, aPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -155,6 +163,7 @@ nsresult NS_InitEmbedding(const char *aPath)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsresult NS_TermEmbedding()
|
||||
{
|
||||
// Reentrant calls to this method do nothing except decrement a counter
|
||||
|
|
|
@ -25,7 +25,10 @@
|
|||
#ifndef NSEMBEDAPI_H
|
||||
#define NSEMBEDAPI_H
|
||||
|
||||
#include "nsILocalFile.h"
|
||||
|
||||
extern nsresult NS_InitEmbedding(const char *aPath);
|
||||
extern nsresult NS_InitEmbedding(nsILocalFile *aPath);
|
||||
extern nsresult NS_TermEmbedding();
|
||||
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче