| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Adam Barth. All Rights Reserved. | 2 * Copyright (C) 2011 Adam Barth. All Rights Reserved. |
| 3 * Copyright (C) 2011 Daniel Bates (dbates@intudata.com). | 3 * Copyright (C) 2011 Daniel Bates (dbates@intudata.com). |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 if (startsSingleLineCommentAt(string, foundPosition) | 760 if (startsSingleLineCommentAt(string, foundPosition) |
| 761 || startsMultiLineCommentAt(string, foundPosition) | 761 || startsMultiLineCommentAt(string, foundPosition) |
| 762 || startsHTMLCommentAt(string, foundPosition)) { | 762 || startsHTMLCommentAt(string, foundPosition)) { |
| 763 break; | 763 break; |
| 764 } | 764 } |
| 765 } | 765 } |
| 766 if (string[foundPosition] == ',' || string[foundPosition] == '`') | 766 if (string[foundPosition] == ',' || string[foundPosition] == '`') |
| 767 break; | 767 break; |
| 768 | 768 |
| 769 if (lastNonSpacePosition != kNotFound && startsOpeningScriptTagAt(st
ring, foundPosition)) { | 769 if (lastNonSpacePosition != kNotFound && startsOpeningScriptTagAt(st
ring, foundPosition)) { |
| 770 foundPosition = lastNonSpacePosition; | 770 foundPosition = lastNonSpacePosition + 1; |
| 771 break; | 771 break; |
| 772 } | 772 } |
| 773 if (foundPosition > startPosition + kMaximumFragmentLengthTarget) { | 773 if (foundPosition > startPosition + kMaximumFragmentLengthTarget) { |
| 774 // After hitting the length target, we can only stop at a point
where we know we are | 774 // After hitting the length target, we can only stop at a point
where we know we are |
| 775 // not in the middle of a %-escape sequence. For the sake of sim
plicity, approximate | 775 // not in the middle of a %-escape sequence. For the sake of sim
plicity, approximate |
| 776 // not stopping inside a (possibly multiply encoded) %-escape se
quence by breaking on | 776 // not stopping inside a (possibly multiply encoded) %-escape se
quence by breaking on |
| 777 // whitespace only. We should have enough text in these cases to
avoid false positives. | 777 // whitespace only. We should have enough text in these cases to
avoid false positives. |
| 778 if (isHTMLSpace<UChar>(string[foundPosition])) | 778 if (isHTMLSpace<UChar>(string[foundPosition])) |
| 779 break; | 779 break; |
| 780 } | 780 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 | 822 |
| 823 bool XSSAuditor::isSafeToSendToAnotherThread() const | 823 bool XSSAuditor::isSafeToSendToAnotherThread() const |
| 824 { | 824 { |
| 825 return m_documentURL.isSafeToSendToAnotherThread() | 825 return m_documentURL.isSafeToSendToAnotherThread() |
| 826 && m_decodedURL.isSafeToSendToAnotherThread() | 826 && m_decodedURL.isSafeToSendToAnotherThread() |
| 827 && m_decodedHTTPBody.isSafeToSendToAnotherThread() | 827 && m_decodedHTTPBody.isSafeToSendToAnotherThread() |
| 828 && m_httpBodyAsString.isSafeToSendToAnotherThread(); | 828 && m_httpBodyAsString.isSafeToSendToAnotherThread(); |
| 829 } | 829 } |
| 830 | 830 |
| 831 } // namespace blink | 831 } // namespace blink |
| OLD | NEW |