#include "nsFeedSniffer.h"
#include "prmem.h"
#include "nsNetCID.h"
#include "nsXPCOM.h"
#include "nsCOMPtr.h"
#include "nsStringStream.h"
#include "nsBrowserCompsCID.h"
#include "nsICategoryManager.h"
#include "nsIServiceManager.h"
#include "nsComponentManagerUtils.h"
#include "nsServiceManagerUtils.h"
#include "nsIStreamConverterService.h"
#include "nsIStreamConverter.h"
#include "nsIStreamListener.h"
#include "nsIHttpChannel.h"
#include "nsIMIMEHeaderParam.h"
#include "nsMimeTypes.h"
Go to the source code of this file.
|
#define | TYPE_ATOM "application/atom+xml" |
|
#define | TYPE_RSS "application/rss+xml" |
|
#define | TYPE_MAYBE_FEED "application/vnd.mozilla.maybe.feed" |
|
#define | NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
|
#define | NS_RSS "http://purl.org/rss/1.0/" |
|
#define | MAX_BYTES 512 |
|
#define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
#define NS_RSS "http://purl.org/rss/1.0/" |
#define TYPE_ATOM "application/atom+xml" |
#define TYPE_MAYBE_FEED "application/vnd.mozilla.maybe.feed" |
#define TYPE_RSS "application/rss+xml" |
static PRBool ContainsTopLevelSubstring |
( |
nsACString & |
dataString, |
|
|
const char * |
substring |
|
) |
| |
|
static |
Determines whether or not a string exists as the root element in an XML data string buffer.
- Parameters
-
dataString | The data being sniffed |
substring | The substring being tested for existence and root-ness. |
- Returns
- PR_TRUE if the substring exists and is the documentElement, PR_FALSE otherwise.
Definition at line 251 of file nsFeedSniffer.cpp.
static const char* FindChar |
( |
char |
c, |
|
|
const char * |
begin, |
|
|
const char * |
end |
|
) |
| |
|
static |
- Returns
- the first occurrence of a character within a string buffer, or nsnull if not found
Definition at line 185 of file nsFeedSniffer.cpp.
PRBool HasAttachmentDisposition |
( |
nsIHttpChannel * |
httpChannel | ) |
|
static PRBool IsDocumentElement |
( |
const char * |
start, |
|
|
const char * |
end |
|
) |
| |
|
static |
Determine if a substring is the "documentElement" in the document.
All of our sniffed substrings: <rss, <feed, <rdf:RDF must be the "document" element within the XML DOM, i.e. the root container element. Otherwise, it's possible that someone embedded one of these tags inside a document of another type, e.g. a HTML document, and we don't want to show the preview page if the document isn't actually a feed.
- Parameters
-
start | The beginning of the data being sniffed |
end | The end of the data being sniffed, right before the substring that was found. |
- Returns
- PR_TRUE if the found substring is the documentElement, PR_FALSE otherwise.
Definition at line 213 of file nsFeedSniffer.cpp.
NS_IMPL_ISUPPORTS3 |
( |
nsFeedSniffer |
, |
|
|
nsIContentSniffer |
, |
|
|
nsIStreamListener |
, |
|
|
nsIRequestObserver |
|
|
) |
| |
template<int N>
static PRBool StringBeginsWithLowercaseLiteral |
( |
nsAString & |
aString, |
|
|
const char(&) |
aSubstring[N] |
|
) |
| |
|
static |