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

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

Issue 2849403002: Use const ref for LocalFrame::LocalFrameRoot and FrameTree::Top (Closed)
Patch Set: fix compile and dchecks 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 9ceb4b53f0290f8d3a22ae079e8c345fd6416bbd..c2891f6ee083b2f91481cd43fd03f775d634951b 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -4912,12 +4912,12 @@ const KURL Document::FirstPartyForCookies() const {
// TODO(mkwst): This doesn't correctly handle sandboxed documents; we want to
// look at their URL, but we can't because we don't know what it is.
- Frame* top = GetFrame()->Tree().Top();
+ Frame& top = GetFrame()->Tree().Top();
KURL top_document_url =
- top->IsLocalFrame()
- ? ToLocalFrame(top)->GetDocument()->Url()
+ top.IsLocalFrame()
+ ? ToLocalFrame(top).GetDocument()->Url()
: KURL(KURL(),
- top->GetSecurityContext()->GetSecurityOrigin()->ToString());
+ top.GetSecurityContext()->GetSecurityOrigin()->ToString());
if (SchemeRegistry::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
top_document_url.Protocol()))
return top_document_url;
@@ -4926,8 +4926,8 @@ const KURL Document::FirstPartyForCookies() const {
// document's SecurityOrigin. Sandboxing a document into a unique origin
// shouldn't effect first-/third-party status for cookies and site data.
const OriginAccessEntry& access_entry =
- top->IsLocalFrame()
- ? ToLocalFrame(top)->GetDocument()->AccessEntryFromURL()
+ top.IsLocalFrame()
+ ? ToLocalFrame(top).GetDocument()->AccessEntryFromURL()
: OriginAccessEntry(top_document_url.Protocol(),
top_document_url.Host(),
OriginAccessEntry::kAllowRegisterableDomains);

Powered by Google App Engine
This is Rietveld 408576698