Hi,
    I am trying to monitor the HTTP Activity, so I am hoping that this
interface would give me a callback, when there is an activity on the
network using Firefox, but the problem I am facing is I couldn't
figure out how to register this

   I have tried the normal Observer method, but I am not getting the
callbacks. Am I missing something ?

        nsCOMPtr<nsIServiceManager> spServiceManager;
        nsresult nsResult =
NS_GetServiceManager(getter_AddRefs(spServiceManager));
        if (NS_FAILED(nsResult))
        {
                C_LOG_CRITICAL_MSG (_T("Failed to get Service Manager"));
                return nsResult;
        }

        nsCOMPtr<nsIObserverService> spObserverService;
        nsResult = spServiceManager-
>GetServiceByContractID(NS_OBSERVERSERVICE_CONTRACTID,
NS_GET_IID(nsIObserverService), getter_AddRefs(spObserverService));
        if (NS_FAILED(nsResult))
        {
                C_LOG_CRITICAL_MSG (_T("Failed to get Observer Service"));
                return nsResult;
        }

        spObserverService->AddObserver (this, "http-on-modify-request",
false);
        spObserverService->AddObserver (this, "http-activity-observer",
false);


The class implements both the nsIObserver, and nsIHttpActivityObserver
interfaces.
Though I think it is wrong to register like this, since AddObserver
takes the nsIObserver interface pointer but nsIHttpActivityObserver
derives from nsISupports. Any help is appreciated.

Thanks
Prasad
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to