12013-02-04 Tony Gentilcore <tonyg@chromium.org>
2
3 Call XSSAuditor's didBlockScript() for the threaded HTML parser
4 https://bugs.webkit.org/show_bug.cgi?id=108726
5
6 Reviewed by NOBODY (OOPS!).
7
8 This patch causes us to call didBlockScript() on the main thread if the CompactHTML token has XSSInfo.
9 To do so, we:
10 1. Rename DidBlockScriptRequest to XSSInfo.
11 2. Add an OwnPtr<XSSInfo> field to CompactHTMLToken.
12 3. Add an isSafeToSendToAnotherThread() method to String and KURL.
13
14 We don't yet populate didBlockScriptRequest on the background thread, but this should just work once we do.
15
16 No new tests because no new functionality.
17
18 * html/parser/BackgroundHTMLParser.cpp:
19 (WebCore::BackgroundHTMLParser::pumpTokenizer): Update comment for rename.
20 * html/parser/CompactHTMLToken.cpp:
21 (SameSizeAsCompactHTMLToken):
22 (WebCore::CompactHTMLToken::CompactHTMLToken): Add a copy constructor used by Vector.
23 (WebCore::CompactHTMLToken::isSafeToSendToAnotherThread): Include new m_xssInfo field in safety check.
24 (WebCore):
25 (WebCore::CompactHTMLToken::xssInfo): Added.
26 (WebCore::CompactHTMLToken::setXSSInfo): Added.
27 * html/parser/CompactHTMLToken.h: Add an OwnPtr<XSSInfo> field to CompactHTMLToken.
28 (WebCore):
29 (CompactHTMLToken):
30 (WTF): Add VectorTraits necessary for copying Vector fields objects that contain an OwnPtr.
31 * html/parser/HTMLDocumentParser.cpp:
32 (WebCore::HTMLDocumentParser::processParsedChunkFromBackgroundParser): Add new didBlockScript() call.
33 (WebCore::HTMLDocumentParser::pumpTokenizer):
34 * html/parser/XSSAuditor.cpp: Renaming.
35 (WebCore::XSSAuditor::filterToken):
36 * html/parser/XSSAuditor.h: Renaming.
37 (WebCore):
38 (XSSAuditor):
39 * html/parser/XSSAuditorDelegate.cpp:
40 (WebCore::XSSInfo::isSafeToSendToAnotherThread):
41 (WebCore):
42 (WebCore::XSSAuditorDelegate::didBlockScript):
43 * html/parser/XSSAuditorDelegate.h:
44 (WebCore::XSSInfo::create):
45 (XSSInfo):
46 (WebCore::XSSInfo::XSSInfo):
47 (XSSAuditorDelegate):
48 * platform/KURL.cpp:
49 (WebCore::KURL::isSafeToSendToAnotherThread): Added.
50 (WebCore):
51 * platform/KURL.h:
52 (KURL):
53 * platform/KURLGoogle.cpp:
54 (WebCore):
55 (WebCore::KURLGooglePrivate::isSafeToSendToAnotherThread): Added.
56 * platform/KURLGooglePrivate.h:
57 (KURLGooglePrivate):
58 * platform/KURLWTFURLImpl.h:
59 (WebCore::KURLWTFURLImpl::isSafeToSendToAnotherThread): Added.
60