Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1438)

Unified Diff: third_party/WebKit/Source/web/LocalFrameClientImpl.cpp

Issue 2834013002: PlzNavigate: make MHTML iframe load working. (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 35672e3b98eb0cb87949f29fafccae7c2958eebf..95487a64b413dba02db0445a1c642707036b718d 100644
--- a/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
+++ b/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
@@ -76,6 +76,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()) {
+ 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
@@ -980,6 +987,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));
}
« no previous file with comments | « third_party/WebKit/Source/web/LocalFrameClientImpl.h ('k') | third_party/WebKit/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698