| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "core/loader/DocumentLoader.h" | 30 #include "core/loader/DocumentLoader.h" |
| 31 | 31 |
| 32 #include <memory> |
| 33 |
| 32 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
| 33 #include "core/dom/WeakIdentifierMap.h" | 35 #include "core/dom/WeakIdentifierMap.h" |
| 34 #include "core/events/Event.h" | 36 #include "core/events/Event.h" |
| 35 #include "core/frame/Deprecation.h" | 37 #include "core/frame/Deprecation.h" |
| 36 #include "core/frame/FrameHost.h" | 38 #include "core/frame/FrameHost.h" |
| 37 #include "core/frame/LocalDOMWindow.h" | 39 #include "core/frame/LocalDOMWindow.h" |
| 38 #include "core/frame/LocalFrame.h" | 40 #include "core/frame/LocalFrame.h" |
| 39 #include "core/frame/Settings.h" | 41 #include "core/frame/Settings.h" |
| 40 #include "core/frame/csp/ContentSecurityPolicy.h" | 42 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 41 #include "core/html/HTMLFrameOwnerElement.h" | 43 #include "core/html/HTMLFrameOwnerElement.h" |
| 42 #include "core/html/parser/TextResourceDecoder.h" | 44 #include "core/html/parser/TextResourceDecoder.h" |
| 43 #include "core/inspector/ConsoleMessage.h" | 45 #include "core/inspector/ConsoleMessage.h" |
| 44 #include "core/inspector/InspectorInstrumentation.h" | 46 #include "core/inspector/InspectorInstrumentation.h" |
| 47 #include "core/inspector/MainThreadDebugger.h" |
| 45 #include "core/loader/FrameFetchContext.h" | 48 #include "core/loader/FrameFetchContext.h" |
| 46 #include "core/loader/FrameLoader.h" | 49 #include "core/loader/FrameLoader.h" |
| 47 #include "core/loader/FrameLoaderClient.h" | 50 #include "core/loader/FrameLoaderClient.h" |
| 48 #include "core/loader/LinkLoader.h" | 51 #include "core/loader/LinkLoader.h" |
| 49 #include "core/loader/NetworkHintsInterface.h" | 52 #include "core/loader/NetworkHintsInterface.h" |
| 50 #include "core/loader/ProgressTracker.h" | 53 #include "core/loader/ProgressTracker.h" |
| 51 #include "core/loader/appcache/ApplicationCacheHost.h" | 54 #include "core/loader/appcache/ApplicationCacheHost.h" |
| 52 #include "core/loader/resource/CSSStyleSheetResource.h" | 55 #include "core/loader/resource/CSSStyleSheetResource.h" |
| 53 #include "core/loader/resource/FontResource.h" | 56 #include "core/loader/resource/FontResource.h" |
| 54 #include "core/loader/resource/ImageResource.h" | 57 #include "core/loader/resource/ImageResource.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 67 #include "platform/network/HTTPParsers.h" | 70 #include "platform/network/HTTPParsers.h" |
| 68 #include "platform/network/mime/MIMETypeRegistry.h" | 71 #include "platform/network/mime/MIMETypeRegistry.h" |
| 69 #include "platform/plugins/PluginData.h" | 72 #include "platform/plugins/PluginData.h" |
| 70 #include "platform/weborigin/SchemeRegistry.h" | 73 #include "platform/weborigin/SchemeRegistry.h" |
| 71 #include "platform/weborigin/SecurityPolicy.h" | 74 #include "platform/weborigin/SecurityPolicy.h" |
| 72 #include "public/platform/Platform.h" | 75 #include "public/platform/Platform.h" |
| 73 #include "public/platform/WebDocumentSubresourceFilter.h" | 76 #include "public/platform/WebDocumentSubresourceFilter.h" |
| 74 #include "wtf/Assertions.h" | 77 #include "wtf/Assertions.h" |
| 75 #include "wtf/AutoReset.h" | 78 #include "wtf/AutoReset.h" |
| 76 #include "wtf/text/WTFString.h" | 79 #include "wtf/text/WTFString.h" |
| 77 #include <memory> | |
| 78 | 80 |
| 79 namespace blink { | 81 namespace blink { |
| 80 | 82 |
| 81 static bool isArchiveMIMEType(const String& mimeType) { | 83 static bool isArchiveMIMEType(const String& mimeType) { |
| 82 return equalIgnoringCase("multipart/related", mimeType); | 84 return equalIgnoringCase("multipart/related", mimeType); |
| 83 } | 85 } |
| 84 | 86 |
| 85 static bool shouldInheritSecurityOriginFromOwner(const KURL& url) { | 87 static bool shouldInheritSecurityOriginFromOwner(const KURL& url) { |
| 86 // https://html.spec.whatwg.org/multipage/browsers.html#origin | 88 // https://html.spec.whatwg.org/multipage/browsers.html#origin |
| 87 // | 89 // |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 m_mainResource.get()); | 297 m_mainResource.get()); |
| 296 } | 298 } |
| 297 | 299 |
| 298 frameLoader().loadFailed(this, m_mainResource->resourceError()); | 300 frameLoader().loadFailed(this, m_mainResource->resourceError()); |
| 299 clearMainResourceHandle(); | 301 clearMainResourceHandle(); |
| 300 } | 302 } |
| 301 | 303 |
| 302 void DocumentLoader::finishedLoading(double finishTime) { | 304 void DocumentLoader::finishedLoading(double finishTime) { |
| 303 DCHECK(m_frame->loader().stateMachine()->creatingInitialEmptyDocument() || | 305 DCHECK(m_frame->loader().stateMachine()->creatingInitialEmptyDocument() || |
| 304 !m_frame->page()->suspended() || | 306 !m_frame->page()->suspended() || |
| 305 InspectorInstrumentation::isDebuggerPaused(m_frame)); | 307 MainThreadDebugger::instance()->isPaused()); |
| 306 | 308 |
| 307 double responseEndTime = finishTime; | 309 double responseEndTime = finishTime; |
| 308 if (!responseEndTime) | 310 if (!responseEndTime) |
| 309 responseEndTime = m_timeOfLastDataReceived; | 311 responseEndTime = m_timeOfLastDataReceived; |
| 310 if (!responseEndTime) | 312 if (!responseEndTime) |
| 311 responseEndTime = monotonicallyIncreasingTime(); | 313 responseEndTime = monotonicallyIncreasingTime(); |
| 312 timing().setResponseEnd(responseEndTime); | 314 timing().setResponseEnd(responseEndTime); |
| 313 | 315 |
| 314 commitIfReady(); | 316 commitIfReady(); |
| 315 if (!m_frame) | 317 if (!m_frame) |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 m_writer ? m_writer->encoding() : emptyAtom, true, | 812 m_writer ? m_writer->encoding() : emptyAtom, true, |
| 811 ForceSynchronousParsing); | 813 ForceSynchronousParsing); |
| 812 if (!source.isNull()) | 814 if (!source.isNull()) |
| 813 m_writer->appendReplacingData(source); | 815 m_writer->appendReplacingData(source); |
| 814 endWriting(); | 816 endWriting(); |
| 815 } | 817 } |
| 816 | 818 |
| 817 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 819 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 818 | 820 |
| 819 } // namespace blink | 821 } // namespace blink |
| OLD | NEW |