Hi all,

I´ve built a component that implements nsIContentPolicy. Firefox 1.0.7 calls my component's ShouldLoad method, Mozilla 1.7.12 doesn't. The registration process goes ok.
        Does anybody have a clue about the cause of this behavior?

        Here is registration code:

NS_IMETHODIMP CAntiPhisher::Registration(nsIComponentManager *aCompMgr,
                                                        nsIFile *aPath,
                                                        const char 
*registryLocation,
                                                        const char 
*componentType,
                                                        const 
nsModuleComponentInfo *info)
{
        nsresult rv=NS_OK;
Log1("[CAntiPhisher::Registration] Start\n");

Log2("[CAntiPhisher::Registration] servman. aCompMgr=%p\n", aCompMgr);
        nsCOMPtr<nsIServiceManager> servman = do_QueryInterface(aCompMgr, &rv);

        if (NS_FAILED(rv))
                return rv;

Log1("[CAntiPhisher::Registration] catman\n");
        nsCOMPtr<nsICategoryManager> catman;
        servman->GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,
                                                                        
NS_GET_IID(nsICategoryManager),
                                                                        
getter_AddRefs(catman));

        if (NS_FAILED(rv))
                return rv;
Log1("[CAntiPhisher::Registration] AddCategoryEntry\n");
        char* previous = NULL;
        rv = catman->AddCategoryEntry("xpcom-startup",
"AntiPhisher",
ANTIPHISHER_CONTRACTID,
TRUE,
TRUE,
&previous);
        if (previous)
                PR_Free(previous);

Log1("[CAntiPhisher::Registration] AddCategoryEntry2\n");
        previous = NULL;
        rv = catman->AddCategoryEntry("content-policy",
ANTIPHISHER_CONTRACTID,
ANTIPHISHER_CONTRACTID,
TRUE,
TRUE,
&previous);

        if (NS_FAILED(rv))
        {
Log1("[CAntiPhisher::Registration] AddCategoryEntry2 failed\n");
        }

        if (previous)
                PR_Free(previous);

Log1("[CAntiPhisher::Registration] End\n");
        return rv;
}

Thanks,

Maciste
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to