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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 5095 matching lines...) Expand 10 before | Expand all | Expand 10 after
5106 const KURL& about_blank_url = BlankURL(); 5106 const KURL& about_blank_url = BlankURL();
5107 should_use_parent_base_url = (base_url_override == about_blank_url); 5107 should_use_parent_base_url = (base_url_override == about_blank_url);
5108 } 5108 }
5109 if (should_use_parent_base_url) { 5109 if (should_use_parent_base_url) {
5110 if (Document* parent = ParentDocument()) 5110 if (Document* parent = ParentDocument())
5111 base_url_from_parent = &parent->BaseURL(); 5111 base_url_from_parent = &parent->BaseURL();
5112 } 5112 }
5113 return base_url_from_parent ? *base_url_from_parent : base_url_override; 5113 return base_url_from_parent ? *base_url_from_parent : base_url_override;
5114 } 5114 }
5115 5115
5116 // static
5117 bool Document::ShouldInheritSecurityOriginFromOwner(const KURL& url) {
5118 // https://html.spec.whatwg.org/multipage/browsers.html#origin
5119 //
5120 // If a Document is the initial "about:blank" document The origin and
5121 // effective script origin of the Document are those it was assigned when its
5122 // browsing context was created.
5123 //
5124 // Note: We generalize this to all "blank" URLs and invalid URLs because we
5125 // treat all of these URLs as about:blank.
5126 return url.IsEmpty() || url.ProtocolIsAbout();
5127 }
5128
5116 KURL Document::OpenSearchDescriptionURL() { 5129 KURL Document::OpenSearchDescriptionURL() {
5117 static const char kOpenSearchMIMEType[] = 5130 static const char kOpenSearchMIMEType[] =
5118 "application/opensearchdescription+xml"; 5131 "application/opensearchdescription+xml";
5119 static const char kOpenSearchRelation[] = "search"; 5132 static const char kOpenSearchRelation[] = "search";
5120 5133
5121 // FIXME: Why do only top-level frames have openSearchDescriptionURLs? 5134 // FIXME: Why do only top-level frames have openSearchDescriptionURLs?
5122 if (!GetFrame() || GetFrame()->Tree().Parent()) 5135 if (!GetFrame() || GetFrame()->Tree().Parent())
5123 return KURL(); 5136 return KURL();
5124 5137
5125 // FIXME: Why do we need to wait for load completion? 5138 // FIXME: Why do we need to wait for load completion?
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
6652 } 6665 }
6653 6666
6654 void showLiveDocumentInstances() { 6667 void showLiveDocumentInstances() {
6655 WeakDocumentSet& set = liveDocumentSet(); 6668 WeakDocumentSet& set = liveDocumentSet();
6656 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6669 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6657 for (blink::Document* document : set) 6670 for (blink::Document* document : set)
6658 fprintf(stderr, "- Document %p URL: %s\n", document, 6671 fprintf(stderr, "- Document %p URL: %s\n", document,
6659 document->Url().GetString().Utf8().Data()); 6672 document->Url().GetString().Utf8().Data());
6660 } 6673 }
6661 #endif 6674 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/frame/FrameOwner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698