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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 // The URL can be empty when opening a new browser window or calling win
dow.open(""). | 250 // The URL can be empty when opening a new browser window or calling win
dow.open(""). |
251 m_isEnabled = false; | 251 m_isEnabled = false; |
252 return; | 252 return; |
253 } | 253 } |
254 | 254 |
255 if (m_documentURL.protocolIsData()) { | 255 if (m_documentURL.protocolIsData()) { |
256 m_isEnabled = false; | 256 m_isEnabled = false; |
257 return; | 257 return; |
258 } | 258 } |
259 | 259 |
260 if (document->decoder()) | 260 if (document->encoding().isValid()) |
261 m_encoding = document->decoder()->encoding(); | 261 m_encoding = document->encoding(); |
262 | 262 |
263 m_decodedURL = fullyDecodeString(m_documentURL.string(), m_encoding); | 263 m_decodedURL = fullyDecodeString(m_documentURL.string(), m_encoding); |
264 if (m_decodedURL.find(isRequiredForInjection) == notFound) | 264 if (m_decodedURL.find(isRequiredForInjection) == notFound) |
265 m_decodedURL = String(); | 265 m_decodedURL = String(); |
266 | 266 |
267 String httpBodyAsString; | 267 String httpBodyAsString; |
268 if (DocumentLoader* documentLoader = document->frame()->loader()->documentLo
ader()) { | 268 if (DocumentLoader* documentLoader = document->frame()->loader()->documentLo
ader()) { |
269 DEFINE_STATIC_LOCAL(String, XSSProtectionHeader, ("X-XSS-Protection")); | 269 DEFINE_STATIC_LOCAL(String, XSSProtectionHeader, ("X-XSS-Protection")); |
270 String headerValue = documentLoader->response().httpHeaderField(XSSProte
ctionHeader); | 270 String headerValue = documentLoader->response().httpHeaderField(XSSProte
ctionHeader); |
271 String errorDetails; | 271 String errorDetails; |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 } | 716 } |
717 | 717 |
718 bool XSSAuditor::isSafeToSendToAnotherThread() const | 718 bool XSSAuditor::isSafeToSendToAnotherThread() const |
719 { | 719 { |
720 return m_documentURL.isSafeToSendToAnotherThread() | 720 return m_documentURL.isSafeToSendToAnotherThread() |
721 && m_decodedURL.isSafeToSendToAnotherThread() | 721 && m_decodedURL.isSafeToSendToAnotherThread() |
722 && m_decodedHTTPBody.isSafeToSendToAnotherThread(); | 722 && m_decodedHTTPBody.isSafeToSendToAnotherThread(); |
723 } | 723 } |
724 | 724 |
725 } // namespace WebCore | 725 } // namespace WebCore |
OLD | NEW |