checking in fix for bug 145147 r=bienvenu sr=mscott a=roc,scc,shaver,jaimejr,etc
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_0_BRANCH@122142 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -541,6 +541,12 @@ NS_IMETHODIMP imgLoader::SupportImageWithMimeType(const char* aMimeType, PRBool
|
||||
}
|
||||
|
||||
NS_IMETHODIMP imgLoader::SupportImageWithContents(const char* aContents, PRUint32 aLength, char** aContentType)
|
||||
{
|
||||
return GetMimeTypeFromContent(aContents, aLength, aContentType);
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsresult imgLoader::GetMimeTypeFromContent(const char* aContents, PRUint32 aLength, char** aContentType)
|
||||
{
|
||||
*aContentType = nsnull;
|
||||
/* Is it a GIF? */
|
||||
|
||||
@@ -50,6 +50,8 @@ public:
|
||||
imgLoader();
|
||||
virtual ~imgLoader();
|
||||
|
||||
static nsresult GetMimeTypeFromContent(const char* aContents, PRUint32 aLength, char** aContentType);
|
||||
|
||||
private:
|
||||
nsresult CreateNewProxyForRequest(imgRequest *aRequest, nsILoadGroup *aLoadGroup,
|
||||
imgIDecoderObserver *aObserver, nsISupports *cx,
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "imgRequest.h"
|
||||
|
||||
#include "imgLoader.h"
|
||||
#include "imgCache.h"
|
||||
#include "imgRequestProxy.h"
|
||||
|
||||
@@ -783,6 +784,5 @@ static NS_METHOD sniff_mimetype_callback(nsIInputStream* in,
|
||||
void
|
||||
imgRequest::SniffMimeType(const char *buf, PRUint32 len)
|
||||
{
|
||||
nsCOMPtr<imgILoader> loader(do_GetService("@mozilla.org/image/loader;1"));
|
||||
loader->SupportImageWithContents(buf, len, getter_Copies(mContentType));
|
||||
imgLoader::GetMimeTypeFromContent(buf, len, getter_Copies(mContentType));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user