| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "core/loader/FrameFetchContext.h" | 54 #include "core/loader/FrameFetchContext.h" |
| 55 #include "core/loader/FrameLoader.h" | 55 #include "core/loader/FrameLoader.h" |
| 56 #include "core/loader/FrameLoaderClient.h" | 56 #include "core/loader/FrameLoaderClient.h" |
| 57 #include "core/loader/LinkLoader.h" | 57 #include "core/loader/LinkLoader.h" |
| 58 #include "core/loader/NetworkHintsInterface.h" | 58 #include "core/loader/NetworkHintsInterface.h" |
| 59 #include "core/loader/ProgressTracker.h" | 59 #include "core/loader/ProgressTracker.h" |
| 60 #include "core/loader/appcache/ApplicationCacheHost.h" | 60 #include "core/loader/appcache/ApplicationCacheHost.h" |
| 61 #include "core/page/FrameTree.h" | 61 #include "core/page/FrameTree.h" |
| 62 #include "core/page/Page.h" | 62 #include "core/page/Page.h" |
| 63 #include "platform/HTTPNames.h" | 63 #include "platform/HTTPNames.h" |
| 64 #include "platform/MIMETypeRegistry.h" |
| 64 #include "platform/UserGestureIndicator.h" | 65 #include "platform/UserGestureIndicator.h" |
| 65 #include "platform/mhtml/ArchiveResource.h" | 66 #include "platform/mhtml/ArchiveResource.h" |
| 66 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" | 67 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" |
| 67 #include "platform/network/HTTPParsers.h" | 68 #include "platform/network/HTTPParsers.h" |
| 68 #include "platform/plugins/PluginData.h" | 69 #include "platform/plugins/PluginData.h" |
| 69 #include "platform/weborigin/SchemeRegistry.h" | 70 #include "platform/weborigin/SchemeRegistry.h" |
| 70 #include "platform/weborigin/SecurityPolicy.h" | 71 #include "platform/weborigin/SecurityPolicy.h" |
| 71 #include "public/platform/Platform.h" | 72 #include "public/platform/Platform.h" |
| 72 #include "public/platform/WebDocumentSubresourceFilter.h" | 73 #include "public/platform/WebDocumentSubresourceFilter.h" |
| 73 #include "public/platform/WebMimeRegistry.h" | |
| 74 #include "wtf/Assertions.h" | 74 #include "wtf/Assertions.h" |
| 75 #include "wtf/AutoReset.h" | 75 #include "wtf/AutoReset.h" |
| 76 #include "wtf/text/WTFString.h" | 76 #include "wtf/text/WTFString.h" |
| 77 #include <memory> | 77 #include <memory> |
| 78 | 78 |
| 79 namespace blink { | 79 namespace blink { |
| 80 | 80 |
| 81 static bool isArchiveMIMEType(const String& mimeType) { | 81 static bool isArchiveMIMEType(const String& mimeType) { |
| 82 return equalIgnoringCase("multipart/related", mimeType); | 82 return equalIgnoringCase("multipart/related", mimeType); |
| 83 } | 83 } |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 340 |
| 341 DCHECK(timing().fetchStart()); | 341 DCHECK(timing().fetchStart()); |
| 342 appendRedirect(requestURL); | 342 appendRedirect(requestURL); |
| 343 didRedirect(redirectResponse.url(), requestURL); | 343 didRedirect(redirectResponse.url(), requestURL); |
| 344 frameLoader()->client()->dispatchDidReceiveServerRedirectForProvisionalLoad(); | 344 frameLoader()->client()->dispatchDidReceiveServerRedirectForProvisionalLoad(); |
| 345 | 345 |
| 346 return true; | 346 return true; |
| 347 } | 347 } |
| 348 | 348 |
| 349 static bool canShowMIMEType(const String& mimeType, LocalFrame* frame) { | 349 static bool canShowMIMEType(const String& mimeType, LocalFrame* frame) { |
| 350 if (Platform::current()->mimeRegistry()->supportsMIMEType(mimeType) == | 350 if (MIMETypeRegistry::isSupportedMIMEType(mimeType)) |
| 351 WebMimeRegistry::IsSupported) | |
| 352 return true; | 351 return true; |
| 353 PluginData* pluginData = frame->pluginData(); | 352 PluginData* pluginData = frame->pluginData(); |
| 354 return !mimeType.isEmpty() && pluginData && | 353 return !mimeType.isEmpty() && pluginData && |
| 355 pluginData->supportsMimeType(mimeType); | 354 pluginData->supportsMimeType(mimeType); |
| 356 } | 355 } |
| 357 | 356 |
| 358 bool DocumentLoader::shouldContinueForResponse() const { | 357 bool DocumentLoader::shouldContinueForResponse() const { |
| 359 if (m_substituteData.isValid()) | 358 if (m_substituteData.isValid()) |
| 360 return true; | 359 return true; |
| 361 | 360 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 m_writer ? m_writer->encoding() : emptyAtom, true, | 786 m_writer ? m_writer->encoding() : emptyAtom, true, |
| 788 ForceSynchronousParsing); | 787 ForceSynchronousParsing); |
| 789 if (!source.isNull()) | 788 if (!source.isNull()) |
| 790 m_writer->appendReplacingData(source); | 789 m_writer->appendReplacingData(source); |
| 791 endWriting(); | 790 endWriting(); |
| 792 } | 791 } |
| 793 | 792 |
| 794 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 793 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 795 | 794 |
| 796 } // namespace blink | 795 } // namespace blink |
| OLD | NEW |