Chromium Code Reviews| Index: third_party/WebKit/Source/web/LocalFrameClientImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp b/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp |
| index 07cb12537070ca99f3cab5b5fd25e575de895d9e..516da39b481dbb3c082a432c3548d70447125718 100644 |
| --- a/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp |
| +++ b/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp |
| @@ -74,6 +74,7 @@ |
| #include "platform/exported/WrappedResourceRequest.h" |
| #include "platform/exported/WrappedResourceResponse.h" |
| #include "platform/feature_policy/FeaturePolicy.h" |
| +#include "platform/loader/fetch/ResourceFetcher.h" |
| #include "platform/network/HTTPParsers.h" |
| #include "platform/network/mime/MIMETypeRegistry.h" |
| #include "platform/plugins/PluginData.h" |
| @@ -514,6 +515,12 @@ NavigationPolicy LocalFrameClientImpl::DecidePolicyForNavigation( |
| kCheckContentSecurityPolicy |
| ? kWebContentSecurityPolicyDispositionCheck |
| : kWebContentSecurityPolicyDispositionDoNotCheck; |
| + |
| + if (IsLoadedAsMHTMLArchive()) { |
|
Nate Chapin
2017/05/05 20:34:18
Could we inline this and share some logic with is_
|
| + navigation_info.archive_status = |
| + WebFrameClient::NavigationPolicyInfo::ArchiveStatus::Present; |
| + } |
| + |
| // Caching could be disabled for requests initiated by DevTools. |
| // TODO(ananta) |
| // We should extract the network cache state into a global component which |
| @@ -972,6 +979,26 @@ WebDevToolsAgentImpl* LocalFrameClientImpl::DevToolsAgent() { |
| ->DevToolsAgentImpl(); |
| } |
| +bool LocalFrameClientImpl::IsLoadedAsMHTMLArchive() const { |
| + WebFrame* parent_frame = web_frame_->Parent(); |
| + if (!parent_frame) |
| + return false; |
| + |
| + // TODO(nasko): How should this work with OOPIF? |
| + // The MHTMLArchive is parsed as a whole, but can be constructed from frames |
| + // in multiple processes. In that case, which process should parse it and how |
| + // should the output be spread back across multiple processes? |
| + if (!parent_frame->IsWebLocalFrame()) |
| + return false; |
| + |
| + return ToWebLocalFrameImpl(parent_frame) |
| + ->GetFrame() |
| + ->Loader() |
| + .GetDocumentLoader() |
| + ->Fetcher() |
| + ->Archive(); |
| +} |
| + |
| KURL LocalFrameClientImpl::OverrideFlashEmbedWithHTML(const KURL& url) { |
| return web_frame_->Client()->OverrideFlashEmbedWithHTML(WebURL(url)); |
| } |