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

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

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Addressing comments from PS#6 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 221b5d1b93bf9ac66a8b100a51fd0e962a2a2521..a155b69a91237ad521db15ee0e615a9fe3c1634e 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 EqualIgnoringCase("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,
@@ -676,7 +664,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();
@@ -1014,11 +1002,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);

Powered by Google App Engine
This is Rietveld 408576698