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 20 matching lines...) Expand all Loading... |
31 #include "core/dom/DOMException.h" | 31 #include "core/dom/DOMException.h" |
32 #include "core/dom/DOMImplementation.h" | 32 #include "core/dom/DOMImplementation.h" |
33 #include "core/dom/DOMTypedArray.h" | 33 #include "core/dom/DOMTypedArray.h" |
34 #include "core/dom/DocumentInit.h" | 34 #include "core/dom/DocumentInit.h" |
35 #include "core/dom/DocumentParser.h" | 35 #include "core/dom/DocumentParser.h" |
36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
37 #include "core/dom/ExecutionContext.h" | 37 #include "core/dom/ExecutionContext.h" |
38 #include "core/dom/XMLDocument.h" | 38 #include "core/dom/XMLDocument.h" |
39 #include "core/editing/serializers/Serialization.h" | 39 #include "core/editing/serializers/Serialization.h" |
40 #include "core/events/Event.h" | 40 #include "core/events/Event.h" |
| 41 #include "core/events/ProgressEvent.h" |
41 #include "core/fetch/CrossOriginAccessControl.h" | 42 #include "core/fetch/CrossOriginAccessControl.h" |
42 #include "core/fetch/FetchInitiatorTypeNames.h" | 43 #include "core/fetch/FetchInitiatorTypeNames.h" |
43 #include "core/fetch/FetchUtils.h" | 44 #include "core/fetch/FetchUtils.h" |
44 #include "core/fetch/ResourceLoaderOptions.h" | 45 #include "core/fetch/ResourceLoaderOptions.h" |
45 #include "core/fileapi/Blob.h" | 46 #include "core/fileapi/Blob.h" |
46 #include "core/fileapi/File.h" | 47 #include "core/fileapi/File.h" |
47 #include "core/fileapi/FileReaderLoader.h" | 48 #include "core/fileapi/FileReaderLoader.h" |
48 #include "core/fileapi/FileReaderLoaderClient.h" | 49 #include "core/fileapi/FileReaderLoaderClient.h" |
49 #include "core/frame/Settings.h" | 50 #include "core/frame/Settings.h" |
50 #include "core/frame/UseCounter.h" | 51 #include "core/frame/UseCounter.h" |
51 #include "core/frame/csp/ContentSecurityPolicy.h" | 52 #include "core/frame/csp/ContentSecurityPolicy.h" |
52 #include "core/html/FormData.h" | 53 #include "core/html/FormData.h" |
53 #include "core/html/HTMLDocument.h" | 54 #include "core/html/HTMLDocument.h" |
54 #include "core/html/parser/TextResourceDecoder.h" | 55 #include "core/html/parser/TextResourceDecoder.h" |
55 #include "core/inspector/ConsoleMessage.h" | 56 #include "core/inspector/ConsoleMessage.h" |
56 #include "core/inspector/InspectorInstrumentation.h" | 57 #include "core/inspector/InspectorInstrumentation.h" |
57 #include "core/inspector/InspectorTraceEvents.h" | 58 #include "core/inspector/InspectorTraceEvents.h" |
58 #include "core/loader/ThreadableLoader.h" | 59 #include "core/loader/ThreadableLoader.h" |
59 #include "core/page/ChromeClient.h" | 60 #include "core/page/ChromeClient.h" |
60 #include "core/page/Page.h" | 61 #include "core/page/Page.h" |
61 #include "core/streams/Stream.h" | 62 #include "core/streams/Stream.h" |
62 #include "core/xmlhttprequest/XMLHttpRequestProgressEvent.h" | |
63 #include "core/xmlhttprequest/XMLHttpRequestUpload.h" | 63 #include "core/xmlhttprequest/XMLHttpRequestUpload.h" |
64 #include "platform/FileMetadata.h" | 64 #include "platform/FileMetadata.h" |
65 #include "platform/HTTPNames.h" | 65 #include "platform/HTTPNames.h" |
66 #include "platform/Histogram.h" | 66 #include "platform/Histogram.h" |
67 #include "platform/Logging.h" | 67 #include "platform/Logging.h" |
68 #include "platform/RuntimeEnabledFeatures.h" | 68 #include "platform/RuntimeEnabledFeatures.h" |
69 #include "platform/SharedBuffer.h" | 69 #include "platform/SharedBuffer.h" |
70 #include "platform/blob/BlobData.h" | 70 #include "platform/blob/BlobData.h" |
71 #include "platform/network/HTTPParsers.h" | 71 #include "platform/network/HTTPParsers.h" |
72 #include "platform/network/ParsedContentType.h" | 72 #include "platform/network/ParsedContentType.h" |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 } | 856 } |
857 | 857 |
858 // The presence of upload event listeners forces us to use preflighting beca
use POSTing to an URL that does not | 858 // The presence of upload event listeners forces us to use preflighting beca
use POSTing to an URL that does not |
859 // permit cross origin requests should look exactly like POSTing to an URL t
hat does not respond at all. | 859 // permit cross origin requests should look exactly like POSTing to an URL t
hat does not respond at all. |
860 // Also, only async requests support upload progress events. | 860 // Also, only async requests support upload progress events. |
861 bool uploadEvents = false; | 861 bool uploadEvents = false; |
862 if (m_async) { | 862 if (m_async) { |
863 dispatchProgressEvent(EventTypeNames::loadstart, 0, 0); | 863 dispatchProgressEvent(EventTypeNames::loadstart, 0, 0); |
864 if (httpBody && m_upload) { | 864 if (httpBody && m_upload) { |
865 uploadEvents = m_upload->hasEventListeners(); | 865 uploadEvents = m_upload->hasEventListeners(); |
866 m_upload->dispatchEvent(XMLHttpRequestProgressEvent::create(EventTyp
eNames::loadstart)); | 866 m_upload->dispatchEvent(ProgressEvent::create(EventTypeNames::loadst
art, false, 0, 0)); |
867 } | 867 } |
868 } | 868 } |
869 | 869 |
870 m_sameOriginRequest = securityOrigin()->canRequestNoSuborigin(m_url); | 870 m_sameOriginRequest = securityOrigin()->canRequestNoSuborigin(m_url); |
871 | 871 |
872 // We also remember whether upload events should be allowed for this request
in case the upload listeners are | 872 // We also remember whether upload events should be allowed for this request
in case the upload listeners are |
873 // added after the request is started. | 873 // added after the request is started. |
874 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !FetchUtils::
isSimpleRequest(m_method, m_requestHeaders); | 874 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !FetchUtils::
isSimpleRequest(m_method, m_requestHeaders); |
875 | 875 |
876 ASSERT(executionContext()); | 876 ASSERT(executionContext()); |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 visitor->trace(m_responseDocumentParser); | 1704 visitor->trace(m_responseDocumentParser); |
1705 visitor->trace(m_progressEventThrottle); | 1705 visitor->trace(m_progressEventThrottle); |
1706 visitor->trace(m_upload); | 1706 visitor->trace(m_upload); |
1707 visitor->trace(m_blobLoader); | 1707 visitor->trace(m_blobLoader); |
1708 XMLHttpRequestEventTarget::trace(visitor); | 1708 XMLHttpRequestEventTarget::trace(visitor); |
1709 DocumentParserClient::trace(visitor); | 1709 DocumentParserClient::trace(visitor); |
1710 ActiveDOMObject::trace(visitor); | 1710 ActiveDOMObject::trace(visitor); |
1711 } | 1711 } |
1712 | 1712 |
1713 } // namespace blink | 1713 } // namespace blink |
OLD | NEW |