NS_IMETHODIMP PSMContentListener::DoContent(const nsACString& aContentType, bool aIsContentPreferred, nsIRequest* aRequest, nsIStreamListener** aContentHandler, bool* aAbortProcess) { uint32_t type; type = getPSMContentType(PromiseFlatCString(aContentType).get()); #ifdef PR_LOGGING if (gPIPNSSLog) { PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("PSMContentListener::DoContent\n")); } #endif if (type != UNKNOWN_TYPE) { nsCOMPtr<nsIStreamListener> downloader; if (XRE_GetProcessType() == GeckoProcessType_Default) { downloader = new PSMContentStreamListener(type); } else { downloader = static_cast<PSMContentDownloaderChild*>( dom::ContentChild::GetSingleton()->SendPPSMContentDownloaderConstructor(type)); } downloader.forget(aContentHandler); return NS_OK; } return NS_ERROR_FAILURE; }
NS_IMETHODIMP PSMContentListener::CanHandleContent(const char* aContentType, bool aIsContentPreferred, char** aDesiredContentType, bool* aCanHandleContent) { uint32_t type = getPSMContentType(aContentType); *aCanHandleContent = (type != UNKNOWN_TYPE); return NS_OK; }
NS_IMETHODIMP PSMContentListener::CanHandleContent(const char * aContentType, bool aIsContentPreferred, char ** aDesiredContentType, bool * aCanHandleContent) { uint32_t type; type = getPSMContentType(aContentType); if (type == PSMContentDownloader::UNKNOWN_TYPE) { *aCanHandleContent = false; } else { *aCanHandleContent = true; } return NS_OK; }
NS_IMETHODIMP PSMContentListener::DoContent(const nsACString & aContentType, bool aIsContentPreferred, nsIRequest * aRequest, nsIStreamListener ** aContentHandler, bool * aAbortProcess) { uint32_t type; type = getPSMContentType(PromiseFlatCString(aContentType).get()); PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("PSMContentListener::DoContent\n")); if (type != PSMContentDownloader::UNKNOWN_TYPE) { nsRefPtr<PSMContentDownloader> downLoader = new PSMContentDownloader(type); downLoader.forget(aContentHandler); return NS_OK; } return NS_ERROR_FAILURE; }
NS_IMETHODIMP PSMContentListener::DoContent(const char * aContentType, bool aIsContentPreferred, nsIRequest * aRequest, nsIStreamListener ** aContentHandler, bool * aAbortProcess) { PSMContentDownloader *downLoader; uint32_t type; type = getPSMContentType(aContentType); PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("PSMContentListener::DoContent\n")); if (type != PSMContentDownloader::UNKNOWN_TYPE) { downLoader = new PSMContentDownloader(type); if (downLoader) { downLoader->QueryInterface(NS_GET_IID(nsIStreamListener), (void **)aContentHandler); return NS_OK; } } return NS_ERROR_FAILURE; }