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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 XSSAuditor(); | 61 XSSAuditor(); |
62 | 62 |
63 void init(Document*, XSSAuditorDelegate*); | 63 void init(Document*, XSSAuditorDelegate*); |
64 void initForFragment(); | 64 void initForFragment(); |
65 | 65 |
66 PassOwnPtr<XSSInfo> filterToken(const FilterTokenRequest&); | 66 PassOwnPtr<XSSInfo> filterToken(const FilterTokenRequest&); |
67 bool isSafeToSendToAnotherThread() const; | 67 bool isSafeToSendToAnotherThread() const; |
68 | 68 |
69 void setEncoding(const WTF::TextEncoding&); | 69 void setEncoding(const WTF::TextEncoding&); |
70 | 70 |
| 71 bool isEnabled() const { return m_isEnabled; } |
| 72 |
71 private: | 73 private: |
72 static const size_t kMaximumFragmentLengthTarget = 100; | 74 static const size_t kMaximumFragmentLengthTarget = 100; |
73 | 75 |
74 enum State { | 76 enum State { |
75 Uninitialized, | 77 Uninitialized, |
76 FilteringTokens, | 78 FilteringTokens, |
77 PermittingAdjacentCharacterTokens, | 79 PermittingAdjacentCharacterTokens, |
78 SuppressingAdjacentCharacterTokens | 80 SuppressingAdjacentCharacterTokens |
79 }; | 81 }; |
80 | 82 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 134 |
133 State m_state; | 135 State m_state; |
134 bool m_scriptTagFoundInRequest; | 136 bool m_scriptTagFoundInRequest; |
135 unsigned m_scriptTagNestingLevel; | 137 unsigned m_scriptTagNestingLevel; |
136 WTF::TextEncoding m_encoding; | 138 WTF::TextEncoding m_encoding; |
137 }; | 139 }; |
138 | 140 |
139 } | 141 } |
140 | 142 |
141 #endif | 143 #endif |
OLD | NEW |