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

Unified Diff: Source/core/loader/DocumentLoader.cpp

Issue 161383002: Disabling JavaScript in MHTML and limiting MHTML loading to top frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Last upload seemed confused Created 6 years, 10 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
« no previous file with comments | « LayoutTests/platform/win/mhtml/invalid-bad-boundary2-expected.png ('k') | Source/web/tests/MHTMLTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentLoader.cpp
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index 260a05303bb5078ae1ef963e6a89da0e2ba25e8d..f0e50233481e6455379246ba7f25ee39c0c9a8cd 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -279,6 +279,9 @@ void DocumentLoader::finishedLoading(double finishTime)
}
m_applicationCacheHost->finishedLoadingMainResource();
clearMainResourceHandle();
+
+ if (m_archive && document())
+ document()->enforceSandboxFlags(SandboxAll);
abarth-chromium 2014/02/12 23:35:39 This is probably too late. You want to enforce th
}
bool DocumentLoader::isRedirectAfterPost(const ResourceRequest& newRequest, const ResourceResponse& redirectResponse)
@@ -608,6 +611,10 @@ bool DocumentLoader::isLoadingInAPISense() const
bool DocumentLoader::maybeCreateArchive()
{
+ // Only the top-frame can load MHTML.
+ if (m_frame->tree().parent())
+ return false;
+
// Give the archive machinery a crack at this document. If the MIME type is not an archive type, it will return 0.
if (!isArchiveMIMEType(m_response.mimeType()))
return false;
« no previous file with comments | « LayoutTests/platform/win/mhtml/invalid-bad-boundary2-expected.png ('k') | Source/web/tests/MHTMLTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698