void xxxNeverCalledXUL() { XRE_main(0, nsnull, nsnull); XRE_GetFileFromPath(nsnull, nsnull); XRE_GetStaticComponents(nsnull, nsnull); XRE_InitEmbedding(nsnull, nsnull, nsnull, nsnull, 0); XRE_TermEmbedding(); }
extern "C" NS_EXPORT void JNICALL GRE_NATIVE(termEmbedding) (JNIEnv *env, jobject) { // Free globals before calling XRE_TermEmbedding(), since we need some // XPCOM services. FreeJavaGlobals(env); XRE_TermEmbedding(); }
void xxxNeverCalledXUL() { XRE_main(0, nsnull, nsnull); XRE_GetFileFromPath(nsnull, nsnull); XRE_GetStaticComponents(nsnull, nsnull); XRE_LockProfileDirectory(nsnull, nsnull); XRE_InitEmbedding(nsnull, nsnull, nsnull, nsnull, 0); XRE_NotifyProfile(); XRE_TermEmbedding(); XRE_CreateAppData(nsnull, nsnull); XRE_ParseAppData(nsnull, nsnull); XRE_FreeAppData(nsnull); }
/* static */ void EmbedPrivate::PopStartup(void) { sWidgetCount--; if (sWidgetCount == 0) { // destroy the offscreen window DestroyOffscreenWindow(); // we no longer need a reference to the DirectoryServiceProvider if (sAppFileLocProvider) { NS_RELEASE(sAppFileLocProvider); sAppFileLocProvider = nsnull; } // shut down XPCOM/Embedding XRE_TermEmbedding(); NS_IF_RELEASE(sProfileLock); NS_IF_RELEASE(sProfileDir); } }
bool LLEmbeddedBrowser::reset() { XRE_TermEmbedding(); return true; }
bool LLEmbeddedBrowser::init( std::string applicationDir, std::string componentDir, std::string profileDir, void* nativeWindowHandleIn ) { mNativeWindowHandle = nativeWindowHandleIn; NS_ConvertUTF8toUTF16 applicationDirUTF16(applicationDir.c_str()); NS_ConvertUTF8toUTF16 componentDirUTF16(componentDir.c_str()); NS_ConvertUTF8toUTF16 profileDirUTF16(profileDir.c_str()); nsCOMPtr< nsILocalFile > applicationDirNative; nsresult result = NS_NewLocalFile( applicationDirUTF16, PR_FALSE, getter_AddRefs( applicationDirNative ) ); if ( NS_FAILED( result ) ) { setLastError( 0x1000 ); return false; }; nsCOMPtr< nsILocalFile > componentDirNative; result = NS_NewLocalFile( componentDirUTF16 , PR_FALSE, getter_AddRefs( componentDirNative ) ); if ( NS_FAILED( result ) ) { setLastError( 0x1001 ); return false; }; result = XRE_InitEmbedding( componentDirNative, applicationDirNative, nsnull, nsnull, 0 ); if ( NS_FAILED( result ) ) { setLastError( 0x1002 ); return false; }; nsCOMPtr< nsILocalFile > profileDirNative; result = NS_NewLocalFile( profileDirUTF16 , PR_TRUE, getter_AddRefs( profileDirNative ) ); if ( NS_FAILED( result ) ) { setLastError( 0x1007 ); return false; }; nsCOMPtr< nsProfileDirServiceProvider > locProvider; NS_NewProfileDirServiceProvider( PR_TRUE, getter_AddRefs( locProvider ) ); if ( ! locProvider ) { setLastError( 0x1003 ); XRE_TermEmbedding(); return PR_FALSE; }; result = locProvider->Register(); if ( NS_FAILED( result ) ) { setLastError( 0x1004 ); XRE_TermEmbedding(); return PR_FALSE; }; result = locProvider->SetProfileDir( profileDirNative ); if ( NS_FAILED( result ) ) { setLastError( 0x1005 ); XRE_TermEmbedding(); return PR_FALSE; }; nsCOMPtr<nsIPref> pref = do_CreateInstance( NS_PREF_CONTRACTID ); if ( pref ) { pref->SetBoolPref( "security.warn_entering_secure", PR_FALSE ); pref->SetBoolPref( "security.warn_entering_weak", PR_FALSE ); pref->SetBoolPref( "security.warn_leaving_secure", PR_FALSE ); pref->SetBoolPref( "security.warn_submit_insecure", PR_FALSE ); pref->SetBoolPref( "network.protocol-handler.warn-external-default", PR_FALSE ); } else { setLastError( 0x1006 ); }; // disable proxy by default enableProxy( false, "", 0 ); // Originally from Linux version but seems to help other platforms too nsresult rv; nsCOMPtr<nsIAppShell> appShell; NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID); appShell = do_CreateInstance(kAppShellCID, &rv); if (!appShell) { setLastError( 0x1008 ); return PR_FALSE; } sAppShell = appShell.get(); NS_ADDREF(sAppShell); sAppShell->Create(0, nsnull); sAppShell->Spinup(); clearLastError(); return true; }