part of fix for #46488 - http startup handlers get an Observe() call as well

r=valeski, sr=waterson
This commit is contained in:
alecf%netscape.com 2001-02-15 14:43:34 +00:00
parent fed9703e2b
commit 19bc55bf31
3 changed files with 12 additions and 2 deletions

View File

@ -175,4 +175,5 @@ interface nsIHTTPProtocolHandler : nsIProtocolHandler
// HTTP protocol handler will do_GetService() each CID or Contractid that is registered
// under this category when it comes alive.
#define NS_HTTP_STARTUP_CATEGORY "http-startup-category"
#define NS_HTTP_STARTUP_TOPIC (NS_LITERAL_STRING("http-startup").get())
%}

View File

@ -124,8 +124,8 @@ nsHTTPHandler::GetScheme(char * *o_Scheme)
* @category: Input category
* @return: returns error if any CID or ContractID registered failed to create.
*/
static nsresult
CategoryCreateService( const char *category )
nsresult
nsHTTPHandler::CategoryCreateService(const char *category)
{
nsresult rv = NS_OK;
@ -173,6 +173,13 @@ CategoryCreateService( const char *category )
{
nFailed++;
}
// try an observer, if it implements it.
nsCOMPtr<nsIObserver> observer = do_QueryInterface(instance, &rv);
if (NS_SUCCEEDED(rv) && observer)
observer->Observe(NS_STATIC_CAST(nsISupports*,NS_STATIC_CAST(void*,this)),
NS_HTTP_STARTUP_TOPIC,
NS_LITERAL_STRING("").get());
}
return (nFailed ? NS_ERROR_FAILURE : NS_OK);
}

View File

@ -200,6 +200,8 @@ private:
PRUint32 getCapabilities (const char *host, PRInt32 port, PRUint32 cap);
void setCapabilities (nsIChannel* i_pTrans, PRUint32 aCapabilities);
nsresult CategoryCreateService(const char *category);
PRBool mProxySSLConnectAllowed;
};