> >> The profile service is not builded if you use --enable-single-profile,
> >> and
> >> only really needed if you need to store multiple profiles.
>
> > because no profile manager factory is available in most cases now (thanks
> > to -single-profile)
> > and therefore corresponding applications will never "Make a new default
> > profile" as stated in the comment.
> >
> > In particular mfcembed and other embed application are crashing now when
> > accessed to SSL sites just because of this breakage.
>
> The crash is a bug in the ssl code.
>
> > They have no profile or have no clear way on to create it and nss fails to
> > work for them.
> > Any solution? :)
>
> You have to init the nsprofiledirserviceprovider for the single profile to
> work. Check nsprofiledirserviceprovider.h for details.
>
Thanks for your reply.
If I understood you correctly, the code sequence would look like this:

    nsCOMPtr<nsIFile> appDataDir;
    nsCOMPtr<nsProfileDirServiceProvider> profProvider;

    NS_GetSpecialDirectory(NS_APP_APPLICATION_REGISTRY_DIR, 
getter_AddRefs(appDataDir));
    NS_NewProfileDirServiceProvider(PR_TRUE, getter_AddRefs(profProvider));
    profProvider->Register();
    nsCOMPtr<nsILocalFile> localAppDataDir = appDataDir->QueryInterface(blah 
blah blah);
    profProvider->SetProfileDir(localAppDataDir);

If you take a look into mfcembed, it works like this, but only in case if 
USE_PROFILES is not defined.
By default it is defined and the following code is run:

    m_ProfileMgr = new CProfileMgr;
    m_ProfileMgr->StartUp();

and this StartUp  fails on attempt to find factory for NS_PROFILE_CONTRACTID 
(see its call to do_GetService(NS_PROFILE_CONTRACTID))
I looked through the code base and found that this NS_PROFILE_CONTRACTID is 
never available with single-profile applications.
Effectively it means that USE_PROFILES in mfsembed is not in sync with 
MOZ_SINGLE_PROFILE. Looks like a bug then :)



Regarding SSL, I'm not quite agreed with you. To me it looks like applications 
should care of its profile first, make sure it is
properly created and initialized,
then care of nss3 initialization, right?


_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to