| Index: Source/core/dom/Document.cpp
|
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
|
| index 3efcebd5aca6253b295d850d3d8b7909479a4ace..d21880579b1d0870b4abd444d372512c41834dcc 100644
|
| --- a/Source/core/dom/Document.cpp
|
| +++ b/Source/core/dom/Document.cpp
|
| @@ -4009,7 +4009,7 @@ const KURL& Document::firstPartyForCookies() const
|
| // 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.
|
| - RefPtr<SecurityOrigin> topOrigin = SecurityOrigin::create(topDocument().url());
|
| + OriginAccessEntry accessEntry(topDocument().url().protocol(), topDocument().url().host(), OriginAccessEntry::AllowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress);
|
| const Document* currentDocument = this;
|
| while (currentDocument) {
|
| // Skip over srcdoc documents, as they are always same-origin with their closest non-srcdoc parent.
|
| @@ -4017,7 +4017,7 @@ const KURL& Document::firstPartyForCookies() const
|
| currentDocument = currentDocument->parentDocument();
|
| ASSERT(currentDocument);
|
|
|
| - if (!topOrigin->canRequest(currentDocument->url()))
|
| + if (accessEntry.matchesOrigin(*currentDocument->securityOrigin()) == OriginAccessEntry::DoesNotMatchOrigin)
|
| return SecurityOrigin::urlWithUniqueSecurityOrigin();
|
|
|
| currentDocument = currentDocument->parentDocument();
|
|
|