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

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

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Addressing review comments 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
Index: third_party/WebKit/Source/core/loader/DocumentLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index 63a756bd956e03b5e45cecf9bfca1515eec8ce8b..ad68e74b420db9cce868e3aacdd6600f7b89414e 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -89,18 +89,6 @@ static bool IsArchiveMIMEType(const String& mime_type) {
return DeprecatedEqualIgnoringCase("multipart/related", mime_type);
}
-static bool ShouldInheritSecurityOriginFromOwner(const KURL& url) {
- // https://html.spec.whatwg.org/multipage/browsers.html#origin
- //
- // If a Document is the initial "about:blank" document The origin and
- // effective script origin of the Document are those it was assigned when its
- // browsing context was created.
- //
- // Note: We generalize this to all "blank" URLs and invalid URLs because we
- // treat all of these URLs as about:blank.
- return url.IsEmpty() || url.ProtocolIsAbout();
-}
-
DocumentLoader::DocumentLoader(LocalFrame* frame,
const ResourceRequest& req,
const SubstituteData& substitute_data,
@@ -663,7 +651,7 @@ void DocumentLoader::EnsureWriter(const AtomicString& mime_type,
Document* owner = nullptr;
// TODO(dcheng): This differs from the behavior of both IE and Firefox: the
// origin is inherited from the document that loaded the URL.
- if (ShouldInheritSecurityOriginFromOwner(Url())) {
+ if (Document::ShouldInheritSecurityOriginFromOwner(Url())) {
Frame* owner_frame = frame_->Tree().Parent();
if (!owner_frame)
owner_frame = frame_->Loader().Opener();
@@ -1001,11 +989,8 @@ void SetFeaturePolicy(Document* document, const String& feature_policy_header) {
feature_policy_header, frame->GetSecurityContext()->GetSecurityOrigin(),
&messages);
WebParsedFeaturePolicy container_policy;
- if (frame->Owner()) {
- container_policy = GetContainerPolicyFromAllowedFeatures(
- frame->Owner()->AllowedFeatures(),
- frame->GetSecurityContext()->GetSecurityOrigin());
- }
+ if (frame->Owner())
+ container_policy = frame->Owner()->ContainerPolicy();
frame->GetSecurityContext()->InitializeFeaturePolicy(
parsed_header, container_policy, parent_feature_policy);
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp ('k') | third_party/WebKit/Source/web/LocalFrameClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698