Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1061)

Unified Diff: Source/core/html/HTMLViewSourceDocument.h

Issue 301813002: Highlight relfected XSS vectors in view-source page. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update descriptive text in test cases. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/view-source.css ('k') | Source/core/html/HTMLViewSourceDocument.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLViewSourceDocument.h
diff --git a/Source/core/html/HTMLViewSourceDocument.h b/Source/core/html/HTMLViewSourceDocument.h
index 271c72256347cf48f4e7e07186d961cad636142d..2b8e299e88446f8c99182a1f7c39c35f00943f51 100644
--- a/Source/core/html/HTMLViewSourceDocument.h
+++ b/Source/core/html/HTMLViewSourceDocument.h
@@ -35,12 +35,17 @@ class HTMLToken;
class HTMLViewSourceDocument FINAL : public HTMLDocument {
public:
+ enum SourceAnnotation {
+ AnnotateSourceAsSafe,
+ AnnotateSourceAsXSS
+ };
+
static PassRefPtrWillBeRawPtr<HTMLViewSourceDocument> create(const DocumentInit& initializer, const String& mimeType)
{
return adoptRefWillBeRefCountedGarbageCollected(new HTMLViewSourceDocument(initializer, mimeType));
}
- void addSource(const String&, HTMLToken&);
+ void addSource(const String&, HTMLToken&, SourceAnnotation);
virtual void trace(Visitor*) OVERRIDE;
@@ -51,16 +56,18 @@ private:
void processDoctypeToken(const String& source, HTMLToken&);
void processEndOfFileToken(const String& source, HTMLToken&);
- void processTagToken(const String& source, HTMLToken&);
+ void processTagToken(const String& source, HTMLToken&, SourceAnnotation);
void processCommentToken(const String& source, HTMLToken&);
- void processCharacterToken(const String& source, HTMLToken&);
+ void processCharacterToken(const String& source, HTMLToken&, SourceAnnotation);
void createContainingTable();
PassRefPtrWillBeRawPtr<Element> addSpanWithClassName(const AtomicString&);
void addLine(const AtomicString& className);
void finishLine();
- void addText(const String& text, const AtomicString& className);
+ void addText(const String& text, const AtomicString& className, SourceAnnotation = AnnotateSourceAsSafe);
int addRange(const String& source, int start, int end, const AtomicString& className, bool isLink = false, bool isAnchor = false, const AtomicString& link = nullAtom);
+ void maybeAddSpanForAnnotation(SourceAnnotation);
+
PassRefPtrWillBeRawPtr<Element> addLink(const AtomicString& url, bool isAnchor);
PassRefPtrWillBeRawPtr<Element> addBase(const AtomicString& href);
« no previous file with comments | « Source/core/css/view-source.css ('k') | Source/core/html/HTMLViewSourceDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698