diff --git a/dom/media/webrtc/transport/ipc/WebrtcTCPSocket.cpp b/dom/media/webrtc/transport/ipc/WebrtcTCPSocket.cpp index eb933d59eb0d..b0a7d37a0e0b 100644 --- a/dom/media/webrtc/transport/ipc/WebrtcTCPSocket.cpp +++ b/dom/media/webrtc/transport/ipc/WebrtcTCPSocket.cpp @@ -471,7 +471,7 @@ nsresult WebrtcTCPSocket::OpenWithHttpProxy() { return rv; } - rv = NS_MaybeOpenChannelUsingAsyncOpen(httpChannel, this); + rv = httpChannel->AsyncOpen(this); if (NS_FAILED(rv)) { LOG(("WebrtcTCPSocket %p: cannot async open\n", this)); diff --git a/dom/webbrowserpersist/nsWebBrowserPersist.cpp b/dom/webbrowserpersist/nsWebBrowserPersist.cpp index cf50bd512a34..eac9681f2ccf 100644 --- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp +++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp @@ -1469,8 +1469,7 @@ nsresult nsWebBrowserPersist::SaveChannelInternal(nsIChannel* aChannel, if (fc && !fu) { nsCOMPtr fileInputStream, bufferedInputStream; - nsresult rv = - NS_MaybeOpenChannelUsingOpen(aChannel, getter_AddRefs(fileInputStream)); + nsresult rv = aChannel->Open(getter_AddRefs(fileInputStream)); NS_ENSURE_SUCCESS(rv, rv); rv = NS_NewBufferedInputStream(getter_AddRefs(bufferedInputStream), fileInputStream.forget(), @@ -1488,7 +1487,7 @@ nsresult nsWebBrowserPersist::SaveChannelInternal(nsIChannel* aChannel, } // Read from the input channel - nsresult rv = NS_MaybeOpenChannelUsingAsyncOpen(aChannel, this); + nsresult rv = aChannel->AsyncOpen(this); if (rv == NS_ERROR_NO_CONTENT) { // Assume this is a protocol such as mailto: which does not feed out // data and just ignore it. diff --git a/js/xpconnect/loader/mozJSModuleLoader.cpp b/js/xpconnect/loader/mozJSModuleLoader.cpp index 29469f1a119d..8b0b88664b6e 100644 --- a/js/xpconnect/loader/mozJSModuleLoader.cpp +++ b/js/xpconnect/loader/mozJSModuleLoader.cpp @@ -794,8 +794,7 @@ static mozilla::Result ReadScript( MOZ_TRY(aInfo.EnsureScriptChannel()); nsCOMPtr scriptStream; - MOZ_TRY(NS_MaybeOpenChannelUsingOpen(aInfo.ScriptChannel(), - getter_AddRefs(scriptStream))); + MOZ_TRY(aInfo.ScriptChannel()->Open(getter_AddRefs(scriptStream))); uint64_t len64; uint32_t bytesRead; diff --git a/modules/libjar/zipwriter/nsZipWriter.cpp b/modules/libjar/zipwriter/nsZipWriter.cpp index 0a965871f26c..43c890a7ea06 100644 --- a/modules/libjar/zipwriter/nsZipWriter.cpp +++ b/modules/libjar/zipwriter/nsZipWriter.cpp @@ -378,8 +378,7 @@ NS_IMETHODIMP nsZipWriter::AddEntryChannel(const nsACString& aZipEntry, if (mEntryHash.Get(aZipEntry, nullptr)) return NS_ERROR_FILE_ALREADY_EXISTS; nsCOMPtr inputStream; - nsresult rv = - NS_MaybeOpenChannelUsingOpen(aChannel, getter_AddRefs(inputStream)); + nsresult rv = aChannel->Open(getter_AddRefs(inputStream)); NS_ENSURE_SUCCESS(rv, rv); @@ -934,7 +933,7 @@ inline nsresult nsZipWriter::BeginProcessingAddition(nsZipQueueItem* aItem, rv = pump->AsyncRead(stream); NS_ENSURE_SUCCESS(rv, rv); } else { - rv = NS_MaybeOpenChannelUsingAsyncOpen(aItem->mChannel, stream); + rv = aItem->mChannel->AsyncOpen(stream); NS_ENSURE_SUCCESS(rv, rv); } diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index 249a200ce3be..fcb887140094 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -1057,7 +1057,7 @@ nsresult NS_ImplementChannelOpen(nsIChannel* channel, nsIInputStream** result) { getter_AddRefs(stream)); NS_ENSURE_SUCCESS(rv, rv); - rv = NS_MaybeOpenChannelUsingAsyncOpen(channel, listener); + rv = channel->AsyncOpen(listener); NS_ENSURE_SUCCESS(rv, rv); uint64_t n; @@ -2592,18 +2592,6 @@ nsresult NS_LinkRedirectChannels(uint64_t channelId, return registrar->LinkChannels(channelId, parentChannel, _result); } -nsresult NS_MaybeOpenChannelUsingOpen(nsIChannel* aChannel, - nsIInputStream** aStream) { - nsCOMPtr loadInfo = aChannel->LoadInfo(); - return aChannel->Open(aStream); -} - -nsresult NS_MaybeOpenChannelUsingAsyncOpen(nsIChannel* aChannel, - nsIStreamListener* aListener) { - nsCOMPtr loadInfo = aChannel->LoadInfo(); - return aChannel->AsyncOpen(aListener); -} - nsILoadInfo::CrossOriginEmbedderPolicy NS_GetCrossOriginEmbedderPolicyFromHeader( const nsACString& aHeader, bool aIsOriginTrialCoepCredentiallessEnabled) { diff --git a/netwerk/base/nsNetUtil.h b/netwerk/base/nsNetUtil.h index ce51e399e6ca..fc8c8f39fba2 100644 --- a/netwerk/base/nsNetUtil.h +++ b/netwerk/base/nsNetUtil.h @@ -811,22 +811,6 @@ nsresult NS_LinkRedirectChannels(uint64_t channelId, nsIParentChannel* parentChannel, nsIChannel** _result); -/** - * Helper function which checks whether the channel can be - * openend using Open() or has to fall back to opening - * the channel using Open(). - */ -nsresult NS_MaybeOpenChannelUsingOpen(nsIChannel* aChannel, - nsIInputStream** aStream); - -/** - * Helper function which checks whether the channel can be - * openend using AsyncOpen() or has to fall back to opening - * the channel using AsyncOpen(). - */ -nsresult NS_MaybeOpenChannelUsingAsyncOpen(nsIChannel* aChannel, - nsIStreamListener* aListener); - /** * Returns nsILoadInfo::EMBEDDER_POLICY_REQUIRE_CORP if `aHeader` is * "require-corp" and nsILoadInfo::EMBEDDER_POLICY_NULL otherwise. diff --git a/netwerk/protocol/about/nsAboutCache.cpp b/netwerk/protocol/about/nsAboutCache.cpp index c0303d786333..1873277a7a68 100644 --- a/netwerk/protocol/about/nsAboutCache.cpp +++ b/netwerk/protocol/about/nsAboutCache.cpp @@ -118,7 +118,7 @@ NS_IMETHODIMP nsAboutCache::Channel::AsyncOpen(nsIStreamListener* aListener) { rv = VisitNextStorage(); if (NS_FAILED(rv)) return rv; - rv = NS_MaybeOpenChannelUsingAsyncOpen(mChannel, aListener); + rv = mChannel->AsyncOpen(aListener); if (NS_FAILED(rv)) return rv; return NS_OK; diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index 119baaeaa488..4ff3dc81ba99 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -1350,7 +1350,7 @@ void WebSocketChannel::BeginOpenInternal() { return; } - rv = NS_MaybeOpenChannelUsingAsyncOpen(localChannel, this); + rv = localChannel->AsyncOpen(this); if (NS_FAILED(rv)) { LOG(("WebSocketChannel::BeginOpenInternal: cannot async open\n"));