From f05cd919b8110bc4c89beafc9b6cdef9aed78420 Mon Sep 17 00:00:00 2001 From: Michal Novotny Date: Fri, 4 Jan 2013 00:29:33 +0100 Subject: [PATCH] Bug 725993 - Remove usage of STORE_ON_DISK_AS_FILE flag in plugin code, r=joshmoz --- .../base/nsPluginStreamListenerPeer.cpp | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.cpp b/dom/plugins/base/nsPluginStreamListenerPeer.cpp index 04e859f9a7b5..ce91ff457022 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp +++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp @@ -8,7 +8,6 @@ #include "nsIHttpChannel.h" #include "nsIHttpChannelInternal.h" #include "nsIFileChannel.h" -#include "nsICachingChannel.h" #include "nsMimeTypes.h" #include "nsISupportsPrimitives.h" #include "nsNetCID.h" @@ -359,8 +358,6 @@ nsresult nsPluginStreamListenerPeer::Initialize(nsIURI *aURL, } // SetupPluginCacheFile is called if we have to save the stream to disk. -// the most likely cause for this is either there is no disk cache available -// or the stream is coming from a https server. // // These files will be deleted when the host is destroyed. // @@ -759,13 +756,9 @@ nsresult nsPluginStreamListenerPeer::ServeStreamAsFile(nsIRequest *request, // force the plugin to use stream as file mStreamType = NP_ASFILE; - // then check it out if browser cache is not available - nsCOMPtr cacheChannel = do_QueryInterface(request); - if (!(cacheChannel && (NS_SUCCEEDED(cacheChannel->SetCacheAsFile(true))))) { - nsCOMPtr channel = do_QueryInterface(request); - if (channel) { - SetupPluginCacheFile(channel); - } + nsCOMPtr channel = do_QueryInterface(request); + if (channel) { + SetupPluginCacheFile(channel); } // unset mPendingRequests @@ -984,15 +977,10 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIRequest *request, if (mLocalCachedFileHolder) localFile = mLocalCachedFileHolder->file(); else { - nsCOMPtr cacheChannel = do_QueryInterface(request); - if (cacheChannel) { - cacheChannel->GetCacheFile(getter_AddRefs(localFile)); - } else { - // see if it is a file channel. - nsCOMPtr fileChannel = do_QueryInterface(request); - if (fileChannel) { - fileChannel->GetFile(getter_AddRefs(localFile)); - } + // see if it is a file channel. + nsCOMPtr fileChannel = do_QueryInterface(request); + if (fileChannel) { + fileChannel->GetFile(getter_AddRefs(localFile)); } } @@ -1143,11 +1131,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request, // check it out if this is not a file channel. nsCOMPtr fileChannel = do_QueryInterface(request); if (!fileChannel) { - // and browser cache is not available - nsCOMPtr cacheChannel = do_QueryInterface(request); - if (!(cacheChannel && (NS_SUCCEEDED(cacheChannel->SetCacheAsFile(true))))) { useLocalCache = true; - } } }