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 |
67 private: | 69 private: |
68 static const size_t kMaximumFragmentLengthTarget = 100; | 70 static const size_t kMaximumFragmentLengthTarget = 100; |
69 | 71 |
70 enum State { | 72 enum State { |
71 Uninitialized, | 73 Uninitialized, |
72 FilteringTokens, | 74 FilteringTokens, |
73 PermittingAdjacentCharacterTokens, | 75 PermittingAdjacentCharacterTokens, |
74 SuppressingAdjacentCharacterTokens | 76 SuppressingAdjacentCharacterTokens |
75 }; | 77 }; |
76 | 78 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 110 |
109 KURL m_documentURL; | 111 KURL m_documentURL; |
110 bool m_isEnabled; | 112 bool m_isEnabled; |
111 | 113 |
112 ReflectedXSSDisposition m_xssProtection; | 114 ReflectedXSSDisposition m_xssProtection; |
113 bool m_didSendValidCSPHeader; | 115 bool m_didSendValidCSPHeader; |
114 bool m_didSendValidXSSProtectionHeader; | 116 bool m_didSendValidXSSProtectionHeader; |
115 | 117 |
116 String m_decodedURL; | 118 String m_decodedURL; |
117 String m_decodedHTTPBody; | 119 String m_decodedHTTPBody; |
| 120 String m_httpBodyAsString; |
118 OwnPtr<SuffixTree<ASCIICodebook> > m_decodedHTTPBodySuffixTree; | 121 OwnPtr<SuffixTree<ASCIICodebook> > m_decodedHTTPBodySuffixTree; |
119 | 122 |
120 State m_state; | 123 State m_state; |
121 bool m_scriptTagFoundInRequest; | 124 bool m_scriptTagFoundInRequest; |
122 unsigned m_scriptTagNestingLevel; | 125 unsigned m_scriptTagNestingLevel; |
123 WTF::TextEncoding m_encoding; | 126 WTF::TextEncoding m_encoding; |
124 }; | 127 }; |
125 | 128 |
126 } | 129 } |
127 | 130 |
128 #endif | 131 #endif |
OLD | NEW |