OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Adam Barth. All Rights Reserved. | 2 * Copyright (C) 2011 Adam Barth. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 WTF_MAKE_NONCOPYABLE(XSSAuditor); | 57 WTF_MAKE_NONCOPYABLE(XSSAuditor); |
58 public: | 58 public: |
59 XSSAuditor(); | 59 XSSAuditor(); |
60 | 60 |
61 void init(Document*, XSSAuditorDelegate*); | 61 void init(Document*, XSSAuditorDelegate*); |
62 void initForFragment(); | 62 void initForFragment(); |
63 | 63 |
64 PassOwnPtr<XSSInfo> filterToken(const FilterTokenRequest&); | 64 PassOwnPtr<XSSInfo> filterToken(const FilterTokenRequest&); |
65 bool isSafeToSendToAnotherThread() const; | 65 bool isSafeToSendToAnotherThread() const; |
66 | 66 |
67 void setEncoding(const WTF::TextEncoding&); | |
68 | |
69 private: | 67 private: |
70 static const size_t kMaximumFragmentLengthTarget = 100; | 68 static const size_t kMaximumFragmentLengthTarget = 100; |
71 | 69 |
72 enum State { | 70 enum State { |
73 Uninitialized, | 71 Uninitialized, |
74 FilteringTokens, | 72 FilteringTokens, |
75 PermittingAdjacentCharacterTokens, | 73 PermittingAdjacentCharacterTokens, |
76 SuppressingAdjacentCharacterTokens | 74 SuppressingAdjacentCharacterTokens |
77 }; | 75 }; |
78 | 76 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 108 |
111 KURL m_documentURL; | 109 KURL m_documentURL; |
112 bool m_isEnabled; | 110 bool m_isEnabled; |
113 | 111 |
114 ReflectedXSSDisposition m_xssProtection; | 112 ReflectedXSSDisposition m_xssProtection; |
115 bool m_didSendValidCSPHeader; | 113 bool m_didSendValidCSPHeader; |
116 bool m_didSendValidXSSProtectionHeader; | 114 bool m_didSendValidXSSProtectionHeader; |
117 | 115 |
118 String m_decodedURL; | 116 String m_decodedURL; |
119 String m_decodedHTTPBody; | 117 String m_decodedHTTPBody; |
120 String m_httpBodyAsString; | |
121 OwnPtr<SuffixTree<ASCIICodebook> > m_decodedHTTPBodySuffixTree; | 118 OwnPtr<SuffixTree<ASCIICodebook> > m_decodedHTTPBodySuffixTree; |
122 | 119 |
123 State m_state; | 120 State m_state; |
124 bool m_scriptTagFoundInRequest; | 121 bool m_scriptTagFoundInRequest; |
125 unsigned m_scriptTagNestingLevel; | 122 unsigned m_scriptTagNestingLevel; |
126 WTF::TextEncoding m_encoding; | 123 WTF::TextEncoding m_encoding; |
127 }; | 124 }; |
128 | 125 |
129 } | 126 } |
130 | 127 |
131 #endif | 128 #endif |
OLD | NEW |