Bug 813438 - Part 1: Implement NS_SniffContent; r=bzbarsky

This commit is contained in:
Ehsan Akhgari
2012-11-20 19:19:53 -05:00
parent 6562a9eb53
commit eda236e758
4 changed files with 62 additions and 1 deletions

View File

@@ -34,6 +34,8 @@
#include "nsDNSPrefetch.h"
#include "nsAboutProtocolHandler.h"
#include "nsXULAppAPI.h"
#include "nsCategoryCache.h"
#include "nsIContentSniffer.h"
#include "nsNetCID.h"
@@ -45,6 +47,10 @@
#define BUILD_BINHEX_DECODER 1
#endif
typedef nsCategoryCache<nsIContentSniffer> ContentSnifferCache;
NS_HIDDEN_(ContentSnifferCache*) gNetSniffers = nullptr;
NS_HIDDEN_(ContentSnifferCache*) gDataSniffers = nullptr;
///////////////////////////////////////////////////////////////////////////////
#include "nsIOService.h"
@@ -643,6 +649,11 @@ static void nsNetShutdown()
// Release the Websocket Admission Manager
mozilla::net::WebSocketChannel::Shutdown();
#endif // NECKO_PROTOCOL_websocket
delete gNetSniffers;
gNetSniffers = nullptr;
delete gDataSniffers;
gDataSniffers = nullptr;
}
NS_DEFINE_NAMED_CID(NS_IOSERVICE_CID);