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

Unified Diff: Source/core/html/parser/XSSAuditor.h

Issue 338193002: Refactor XSS Auditor string operations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nameFromAttribute() not needed until next CL lands. Created 6 years, 6 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 | « no previous file | Source/core/html/parser/XSSAuditor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/XSSAuditor.h
diff --git a/Source/core/html/parser/XSSAuditor.h b/Source/core/html/parser/XSSAuditor.h
index 37e463c8d2bb6373d906d83edddf85227a89cce7..2088806d5ac35930538f1aaac6a457ce2ca4b000 100644
--- a/Source/core/html/parser/XSSAuditor.h
+++ b/Source/core/html/parser/XSSAuditor.h
@@ -76,10 +76,11 @@ private:
SuppressingAdjacentCharacterTokens
};
- enum AttributeKind {
- NormalAttribute,
- SrcLikeAttribute,
- ScriptLikeAttribute
+ enum TruncationKind {
+ NoTruncation,
+ NormalAttributeTruncation,
+ SrcLikeAttributeTruncation,
+ ScriptLikeAttributeTruncation
};
bool filterStartToken(const FilterTokenRequest&);
@@ -98,12 +99,12 @@ private:
bool filterButtonToken(const FilterTokenRequest&);
bool eraseDangerousAttributesIfInjected(const FilterTokenRequest&);
- bool eraseAttributeIfInjected(const FilterTokenRequest&, const QualifiedName&, const String& replacementValue = String(), AttributeKind treatment = NormalAttribute);
+ bool eraseAttributeIfInjected(const FilterTokenRequest&, const QualifiedName&, const String& replacementValue = String(), TruncationKind treatment = NormalAttributeTruncation);
- String decodedSnippetForToken(const HTMLToken&);
- String decodedSnippetForName(const FilterTokenRequest&);
- String decodedSnippetForAttribute(const FilterTokenRequest&, const HTMLToken::Attribute&, AttributeKind treatment = NormalAttribute);
- String decodedSnippetForJavaScript(const FilterTokenRequest&);
+ String canonicalizedSnippetForTagName(const FilterTokenRequest&);
+ String canonicalizedSnippetForJavaScript(const FilterTokenRequest&);
+ String snippetFromAttribute(const FilterTokenRequest&, const HTMLToken::Attribute&);
+ String canonicalize(String, TruncationKind);
bool isContainedInRequest(const String&);
bool isLikelySafeResource(const String& url);
« no previous file with comments | « no previous file | Source/core/html/parser/XSSAuditor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698