| 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 | |
| 34 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 35 #include "core/dom/WeakIdentifierMap.h" | 33 #include "core/dom/WeakIdentifierMap.h" |
| 36 #include "core/events/Event.h" | 34 #include "core/events/Event.h" |
| 37 #include "core/frame/Deprecation.h" | 35 #include "core/frame/Deprecation.h" |
| 38 #include "core/frame/FrameHost.h" | 36 #include "core/frame/FrameHost.h" |
| 39 #include "core/frame/LocalDOMWindow.h" | 37 #include "core/frame/LocalDOMWindow.h" |
| 40 #include "core/frame/LocalFrame.h" | 38 #include "core/frame/LocalFrame.h" |
| 41 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
| 42 #include "core/frame/csp/ContentSecurityPolicy.h" | 40 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 43 #include "core/html/HTMLFrameOwnerElement.h" | 41 #include "core/html/HTMLFrameOwnerElement.h" |
| 44 #include "core/html/parser/TextResourceDecoder.h" | 42 #include "core/html/parser/TextResourceDecoder.h" |
| 45 #include "core/inspector/ConsoleMessage.h" | 43 #include "core/inspector/ConsoleMessage.h" |
| 46 #include "core/inspector/InspectorInstrumentation.h" | 44 #include "core/inspector/InspectorInstrumentation.h" |
| 47 #include "core/inspector/MainThreadDebugger.h" | |
| 48 #include "core/loader/FrameFetchContext.h" | 45 #include "core/loader/FrameFetchContext.h" |
| 49 #include "core/loader/FrameLoader.h" | 46 #include "core/loader/FrameLoader.h" |
| 50 #include "core/loader/FrameLoaderClient.h" | 47 #include "core/loader/FrameLoaderClient.h" |
| 51 #include "core/loader/LinkLoader.h" | 48 #include "core/loader/LinkLoader.h" |
| 52 #include "core/loader/NetworkHintsInterface.h" | 49 #include "core/loader/NetworkHintsInterface.h" |
| 53 #include "core/loader/ProgressTracker.h" | 50 #include "core/loader/ProgressTracker.h" |
| 54 #include "core/loader/appcache/ApplicationCacheHost.h" | 51 #include "core/loader/appcache/ApplicationCacheHost.h" |
| 55 #include "core/loader/resource/CSSStyleSheetResource.h" | 52 #include "core/loader/resource/CSSStyleSheetResource.h" |
| 56 #include "core/loader/resource/FontResource.h" | 53 #include "core/loader/resource/FontResource.h" |
| 57 #include "core/loader/resource/ImageResource.h" | 54 #include "core/loader/resource/ImageResource.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 70 #include "platform/network/HTTPParsers.h" | 67 #include "platform/network/HTTPParsers.h" |
| 71 #include "platform/network/mime/MIMETypeRegistry.h" | 68 #include "platform/network/mime/MIMETypeRegistry.h" |
| 72 #include "platform/plugins/PluginData.h" | 69 #include "platform/plugins/PluginData.h" |
| 73 #include "platform/weborigin/SchemeRegistry.h" | 70 #include "platform/weborigin/SchemeRegistry.h" |
| 74 #include "platform/weborigin/SecurityPolicy.h" | 71 #include "platform/weborigin/SecurityPolicy.h" |
| 75 #include "public/platform/Platform.h" | 72 #include "public/platform/Platform.h" |
| 76 #include "public/platform/WebDocumentSubresourceFilter.h" | 73 #include "public/platform/WebDocumentSubresourceFilter.h" |
| 77 #include "wtf/Assertions.h" | 74 #include "wtf/Assertions.h" |
| 78 #include "wtf/AutoReset.h" | 75 #include "wtf/AutoReset.h" |
| 79 #include "wtf/text/WTFString.h" | 76 #include "wtf/text/WTFString.h" |
| 77 #include <memory> |
| 80 | 78 |
| 81 namespace blink { | 79 namespace blink { |
| 82 | 80 |
| 83 static bool isArchiveMIMEType(const String& mimeType) { | 81 static bool isArchiveMIMEType(const String& mimeType) { |
| 84 return equalIgnoringCase("multipart/related", mimeType); | 82 return equalIgnoringCase("multipart/related", mimeType); |
| 85 } | 83 } |
| 86 | 84 |
| 87 static bool shouldInheritSecurityOriginFromOwner(const KURL& url) { | 85 static bool shouldInheritSecurityOriginFromOwner(const KURL& url) { |
| 88 // https://html.spec.whatwg.org/multipage/browsers.html#origin | 86 // https://html.spec.whatwg.org/multipage/browsers.html#origin |
| 89 // | 87 // |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 m_mainResource.get()); | 295 m_mainResource.get()); |
| 298 } | 296 } |
| 299 | 297 |
| 300 frameLoader().loadFailed(this, m_mainResource->resourceError()); | 298 frameLoader().loadFailed(this, m_mainResource->resourceError()); |
| 301 clearMainResourceHandle(); | 299 clearMainResourceHandle(); |
| 302 } | 300 } |
| 303 | 301 |
| 304 void DocumentLoader::finishedLoading(double finishTime) { | 302 void DocumentLoader::finishedLoading(double finishTime) { |
| 305 DCHECK(m_frame->loader().stateMachine()->creatingInitialEmptyDocument() || | 303 DCHECK(m_frame->loader().stateMachine()->creatingInitialEmptyDocument() || |
| 306 !m_frame->page()->suspended() || | 304 !m_frame->page()->suspended() || |
| 307 MainThreadDebugger::instance()->isPaused()); | 305 InspectorInstrumentation::isDebuggerPaused(m_frame)); |
| 308 | 306 |
| 309 double responseEndTime = finishTime; | 307 double responseEndTime = finishTime; |
| 310 if (!responseEndTime) | 308 if (!responseEndTime) |
| 311 responseEndTime = m_timeOfLastDataReceived; | 309 responseEndTime = m_timeOfLastDataReceived; |
| 312 if (!responseEndTime) | 310 if (!responseEndTime) |
| 313 responseEndTime = monotonicallyIncreasingTime(); | 311 responseEndTime = monotonicallyIncreasingTime(); |
| 314 timing().setResponseEnd(responseEndTime); | 312 timing().setResponseEnd(responseEndTime); |
| 315 | 313 |
| 316 commitIfReady(); | 314 commitIfReady(); |
| 317 if (!m_frame) | 315 if (!m_frame) |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 m_writer ? m_writer->encoding() : emptyAtom, true, | 810 m_writer ? m_writer->encoding() : emptyAtom, true, |
| 813 ForceSynchronousParsing); | 811 ForceSynchronousParsing); |
| 814 if (!source.isNull()) | 812 if (!source.isNull()) |
| 815 m_writer->appendReplacingData(source); | 813 m_writer->appendReplacingData(source); |
| 816 endWriting(); | 814 endWriting(); |
| 817 } | 815 } |
| 818 | 816 |
| 819 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 817 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 820 | 818 |
| 821 } // namespace blink | 819 } // namespace blink |
| OLD | NEW |