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

Unified Diff: third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp

Issue 2813123002: Prevent appcache creation from suborigins and sandboxed pages. (Closed)
Patch Set: tests Created 3 years, 8 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 | « third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
index 0335f713a547d8a2fe9fdd0db56b2caa109ef887..030818c1830b6d6e9de482eadfa48626dc0ab807 100644
--- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
+++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
@@ -134,6 +134,12 @@ void ApplicationCacheHost::SelectCacheWithManifest(const KURL& manifest_url) {
LocalFrame* frame = document_loader_->GetFrame();
Document* document = frame->GetDocument();
+ if (document->IsSandboxed(kSandboxOrigin) ||
+ document->GetSecurityOrigin()->HasSuborigin()) {
+ // Prevent sandboxes and suborigins from establishing application caches.
+ SelectCacheWithoutManifest();
+ return;
+ }
if (document->IsSecureContext()) {
UseCounter::Count(document,
UseCounter::kApplicationCacheManifestSelectSecureOrigin);
« no previous file with comments | « third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698