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

Issue 1118373007: Revert of Ancestors count towards first-partyness. (Closed)

Created:
5 years, 7 months ago by Mike West
Modified:
5 years, 7 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Revert of Ancestors count towards first-partyness. (patchset #3 id:40001 of https://codereview.chromium.org/1075163002/) Reason for revert: This apparently produces behavior that diverges from Firefox. Reverting as I'm OOO, and can't really investigate until next week. BUG=482812 Original issue's description: > Ancestors count towards first-partyness. > > We currently set requests' "firstPartyForCookies" property based on the > top-level document's URL. We ought to harden this property to account > for good.com -> evil.com -> good.com ancestor chains. > > The top-level 'good.com' should be considered a first-party context. > The nested 'good.com' should not. > > This CL adds this behavior behind a runtime flag. If the intent to ship > at [1] is approved, I'll remove the flag in a followup CL. > > [1]: https://groups.google.com/a/chromium.org/d/msg/blink-dev/ZvMEJMSU6po/wKWAfpIe6vUJ > > BUG=459154 > > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193884 TBR=jochen@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=459154

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -301 lines) Patch
M Source/core/dom/Document.cpp View 1 chunk +0 lines, -20 lines 0 comments Download
M Source/platform/RuntimeEnabledFeatures.in View 1 chunk +0 lines, -1 line 0 comments Download
M Source/web/tests/WebDocumentTest.cpp View 2 chunks +1 line, -199 lines 0 comments Download
D Source/web/tests/data/first_party/empty.html View 1 chunk +0 lines, -9 lines 0 comments Download
D Source/web/tests/data/first_party/nested-data.html View 1 chunk +0 lines, -9 lines 0 comments Download
D Source/web/tests/data/first_party/nested-originA.html View 1 chunk +0 lines, -9 lines 0 comments Download
D Source/web/tests/data/first_party/nested-originA-in-originA.html View 1 chunk +0 lines, -9 lines 0 comments Download
D Source/web/tests/data/first_party/nested-originA-in-originB.html View 1 chunk +0 lines, -9 lines 0 comments Download
D Source/web/tests/data/first_party/nested-originB.html View 1 chunk +0 lines, -9 lines 0 comments Download
D Source/web/tests/data/first_party/nested-originB-in-originA.html View 1 chunk +0 lines, -9 lines 0 comments Download
D Source/web/tests/data/first_party/nested-originB-in-originB.html View 1 chunk +0 lines, -9 lines 0 comments Download
D Source/web/tests/data/first_party/nested-srcdoc.html View 1 chunk +0 lines, -9 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
Mike West
Created Revert of Ancestors count towards first-partyness.
5 years, 7 months ago (2015-05-05 16:18:27 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1118373007/1
5 years, 7 months ago (2015-05-05 16:18:50 UTC) #2
commit-bot: I haz the power
5 years, 7 months ago (2015-05-05 16:19:56 UTC) #4
Failed to apply patch for Source/core/dom/Document.cpp:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file Source/core/dom/Document.cpp
  Hunk #1 FAILED at 3979.
  1 out of 1 hunk FAILED -- saving rejects to file
Source/core/dom/Document.cpp.rej

Patch:       Source/core/dom/Document.cpp
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index
93ad71a9ecf2d93b25e0ce23347ba706648866b5..fef902a5f5c3d5c032a78b4292bf89db04a492d9
100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -3979,26 +3979,6 @@
 
 const KURL& Document::firstPartyForCookies() const
 {
-    if (!RuntimeEnabledFeatures::firstPartyIncludesAncestorsEnabled())
-        return topDocument().url();
-
-    // 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());
-    const Document* currentDocument = this;
-    while (currentDocument) {
-        // Skip over srcdoc documents, as they are always same-origin with
their closest non-srcdoc parent.
-        while (currentDocument->isSrcdocDocument())
-            currentDocument = currentDocument->parentDocument();
-        ASSERT(currentDocument);
-
-        if (!topOrigin->canRequest(currentDocument->url()))
-            return SecurityOrigin::urlWithUniqueSecurityOrigin();
-
-        currentDocument = currentDocument->parentDocument();
-    }
-
     return topDocument().url();
 }

Powered by Google App Engine
This is Rietveld 408576698