| 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 3d3620f7bc72a1466493b2fb8f27dd059f611505..f4e9881b24b31cc19a4b0f04c5fe6f714e1c18f4 100644
|
| --- a/third_party/WebKit/Source/core/dom/Document.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
| @@ -4178,17 +4178,18 @@ 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.
|
| - KURL topDocumentURL = frame()->tree().top()->isLocalFrame()
|
| - ? topDocument().url()
|
| - : KURL(KURL(), frame()->securityContext()->getSecurityOrigin()->toString());
|
| + Frame* top = frame()->tree().top();
|
| + KURL topDocumentURL = top->isLocalFrame()
|
| + ? toLocalFrame(top)->document()->url()
|
| + : KURL(KURL(), top->securityContext()->getSecurityOrigin()->toString());
|
| if (SchemeRegistry::shouldTreatURLSchemeAsFirstPartyWhenTopLevel(topDocumentURL.protocol()))
|
| return topDocumentURL;
|
|
|
| // We're intentionally using the URL of each document rather than the document's SecurityOrigin.
|
| // Sandboxing a document into a unique origin shouldn't effect first-/third-party status for
|
| // cookies and site data.
|
| - const OriginAccessEntry& accessEntry = frame()->tree().top()->isLocalFrame()
|
| - ? topDocument().accessEntryFromURL()
|
| + const OriginAccessEntry& accessEntry = top->isLocalFrame()
|
| + ? toLocalFrame(top)->document()->accessEntryFromURL()
|
| : OriginAccessEntry(topDocumentURL.protocol(), topDocumentURL.host(), OriginAccessEntry::AllowRegisterableDomains);
|
| const Frame* currentFrame = frame();
|
| while (currentFrame) {
|
|
|