XSSAuditorDelegate.h [plain text]
#ifndef XSSAuditorDelegate_h
#define XSSAuditorDelegate_h
#include "KURL.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/TextPosition.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class Document;
class FormData;
class XSSInfo {
public:
static PassOwnPtr<XSSInfo> create(bool didBlockEntirePage, bool didSendXSSProtectionHeader, bool didSendCSPHeader)
{
return adoptPtr(new XSSInfo(didBlockEntirePage, didSendXSSProtectionHeader, didSendCSPHeader));
}
bool m_didBlockEntirePage;
bool m_didSendXSSProtectionHeader;
bool m_didSendCSPHeader;
TextPosition m_textPosition;
private:
XSSInfo(bool didBlockEntirePage, bool didSendXSSProtectionHeader, bool didSendCSPHeader)
: m_didBlockEntirePage(didBlockEntirePage)
, m_didSendXSSProtectionHeader(didSendXSSProtectionHeader)
, m_didSendCSPHeader(didSendCSPHeader)
{ }
};
class XSSAuditorDelegate {
WTF_MAKE_NONCOPYABLE(XSSAuditorDelegate);
public:
explicit XSSAuditorDelegate(Document*);
void didBlockScript(const XSSInfo&);
void setReportURL(const KURL& url) { m_reportURL = url; }
private:
PassRefPtr<FormData> generateViolationReport();
Document* m_document;
bool m_didSendNotifications;
KURL m_reportURL;
};
typedef Vector<OwnPtr<XSSInfo> > XSSInfoStream;
}
#endif