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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Fix rebase 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/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 9e6b7c37f71635fba78318c06a7f27d988e7ba0e..e112e8b861d4d3ec5cc1b180e6ef9d52d43d93db 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5113,6 +5113,19 @@ const KURL& Document::BaseURLForOverride(const KURL& base_url_override) const {
return base_url_from_parent ? *base_url_from_parent : base_url_override;
}
+// static
+bool Document::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();
+}
+
KURL Document::OpenSearchDescriptionURL() {
static const char kOpenSearchMIMEType[] =
"application/opensearchdescription+xml";

Powered by Google App Engine
This is Rietveld 408576698