OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> | 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> |
4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> | 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> |
5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. | 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. |
6 * Copyright (C) 2012 Intel Corporation | 6 * Copyright (C) 2012 Intel Corporation |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "File.h" | 39 #include "File.h" |
40 #include "HTMLDocument.h" | 40 #include "HTMLDocument.h" |
41 #include "HTTPParsers.h" | 41 #include "HTTPParsers.h" |
42 #include "HistogramSupport.h" | 42 #include "HistogramSupport.h" |
43 #include "InspectorInstrumentation.h" | 43 #include "InspectorInstrumentation.h" |
44 #include "MemoryCache.h" | 44 #include "MemoryCache.h" |
45 #include "ParsedContentType.h" | 45 #include "ParsedContentType.h" |
46 #include "ResourceError.h" | 46 #include "ResourceError.h" |
47 #include "ResourceRequest.h" | 47 #include "ResourceRequest.h" |
48 #include "ScriptCallStack.h" | 48 #include "ScriptCallStack.h" |
| 49 #include "ScriptController.h" |
49 #include "ScriptProfile.h" | 50 #include "ScriptProfile.h" |
50 #include "SecurityOrigin.h" | 51 #include "SecurityOrigin.h" |
51 #include "Settings.h" | 52 #include "Settings.h" |
52 #include "SharedBuffer.h" | 53 #include "SharedBuffer.h" |
53 #include "TextResourceDecoder.h" | 54 #include "TextResourceDecoder.h" |
54 #include "ThreadableLoader.h" | 55 #include "ThreadableLoader.h" |
55 #include "WebCoreMemoryInstrumentation.h" | 56 #include "WebCoreMemoryInstrumentation.h" |
56 #include "XMLHttpRequestException.h" | 57 #include "XMLHttpRequestException.h" |
57 #include "XMLHttpRequestProgressEvent.h" | 58 #include "XMLHttpRequestProgressEvent.h" |
58 #include "XMLHttpRequestUpload.h" | 59 #include "XMLHttpRequestUpload.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 475 |
475 if (!isAllowedHTTPMethod(method)) { | 476 if (!isAllowedHTTPMethod(method)) { |
476 ec = SECURITY_ERR; | 477 ec = SECURITY_ERR; |
477 return; | 478 return; |
478 } | 479 } |
479 | 480 |
480 // FIXME: Convert this to check the isolated world's Content Security Policy
once webkit.org/b/104520 is solved. | 481 // FIXME: Convert this to check the isolated world's Content Security Policy
once webkit.org/b/104520 is solved. |
481 bool shouldBypassMainWorldContentSecurityPolicy = false; | 482 bool shouldBypassMainWorldContentSecurityPolicy = false; |
482 if (scriptExecutionContext()->isDocument()) { | 483 if (scriptExecutionContext()->isDocument()) { |
483 Document* document = static_cast<Document*>(scriptExecutionContext()); | 484 Document* document = static_cast<Document*>(scriptExecutionContext()); |
484 shouldBypassMainWorldContentSecurityPolicy = document->frame()->script()
->shouldBypassMainWorldContentSecurityPolicy(); | 485 if (document->frame()) |
| 486 shouldBypassMainWorldContentSecurityPolicy = document->frame()->scri
pt()->shouldBypassMainWorldContentSecurityPolicy(); |
485 } | 487 } |
486 if (!shouldBypassMainWorldContentSecurityPolicy && !scriptExecutionContext()
->contentSecurityPolicy()->allowConnectToSource(url)) { | 488 if (!shouldBypassMainWorldContentSecurityPolicy && !scriptExecutionContext()
->contentSecurityPolicy()->allowConnectToSource(url)) { |
487 // FIXME: Should this be throwing an exception? | 489 // FIXME: Should this be throwing an exception? |
488 ec = SECURITY_ERR; | 490 ec = SECURITY_ERR; |
489 return; | 491 return; |
490 } | 492 } |
491 | 493 |
492 if (!async && scriptExecutionContext()->isDocument()) { | 494 if (!async && scriptExecutionContext()->isDocument()) { |
493 if (document()->settings() && !document()->settings()->syncXHRInDocument
sEnabled()) { | 495 if (document()->settings() && !document()->settings()->syncXHRInDocument
sEnabled()) { |
494 logConsoleError(scriptExecutionContext(), "Synchronous XMLHttpReques
ts are disabled for this page."); | 496 logConsoleError(scriptExecutionContext(), "Synchronous XMLHttpReques
ts are disabled for this page."); |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 info.addMember(m_responseDocument, "responseDocument"); | 1290 info.addMember(m_responseDocument, "responseDocument"); |
1289 info.addMember(m_binaryResponseBuilder, "binaryResponseBuilder"); | 1291 info.addMember(m_binaryResponseBuilder, "binaryResponseBuilder"); |
1290 info.addMember(m_responseArrayBuffer, "responseArrayBuffer"); | 1292 info.addMember(m_responseArrayBuffer, "responseArrayBuffer"); |
1291 info.addMember(m_lastSendURL, "lastSendURL"); | 1293 info.addMember(m_lastSendURL, "lastSendURL"); |
1292 info.addMember(m_eventTargetData, "eventTargetData"); | 1294 info.addMember(m_eventTargetData, "eventTargetData"); |
1293 info.addMember(m_progressEventThrottle, "progressEventThrottle"); | 1295 info.addMember(m_progressEventThrottle, "progressEventThrottle"); |
1294 info.addMember(m_securityOrigin, "securityOrigin"); | 1296 info.addMember(m_securityOrigin, "securityOrigin"); |
1295 } | 1297 } |
1296 | 1298 |
1297 } // namespace WebCore | 1299 } // namespace WebCore |
OLD | NEW |