rv = nsServiceManager::GetService(kXULContentUtilsCID, NS_GET_IID(nsIXULContentUtils), (nsISupports**) &gXULUtils); if (NS_FAILED(rv)) return;  rv = nsServiceManager::GetService(kXULPrototypeCacheCID, NS_GET_IID(nsIXULPrototypeCache), (nsISupports**) &gXULCache);
XULContentSinkImpl::XULContentSinkImpl(nsresult& rv)    : mText(nsnull),      mTextLength(0),      mTextSize(0),      mConstrainSize(PR_TRUE),      mState(eInProlog),      mParser(nsnull),      mStyleSheetCount(0){    NS_INIT_REFCNT();    if (gRefCnt++ == 0) {        rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,                                                nsnull,                                                NS_GET_IID(nsINameSpaceManager),                                                (void**) &gNameSpaceManager);        if (NS_FAILED(rv)) return;        rv = gNameSpaceManager->RegisterNameSpace(kXULNameSpaceURI, kNameSpaceID_XUL);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to register XUL namespace");        if (NS_FAILED(rv)) return;        kClassAtom          = NS_NewAtom("class");        kIdAtom             = NS_NewAtom("id");        kScriptAtom         = NS_NewAtom("script");        kStyleAtom          = NS_NewAtom("style");        kTemplateAtom       = NS_NewAtom("template");    }#ifdef PR_LOGGING    if (! gLog)        gLog = PR_NewLogModule("nsXULContentSink");#endif    rv = NS_OK;}