OLD | NEW |
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 4894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4905 // If this is an imported document, grab its master document's first-party: | 4905 // If this is an imported document, grab its master document's first-party: |
4906 if (ImportsController() && ImportsController()->Master() && | 4906 if (ImportsController() && ImportsController()->Master() && |
4907 ImportsController()->Master() != this) | 4907 ImportsController()->Master() != this) |
4908 return ImportsController()->Master()->FirstPartyForCookies(); | 4908 return ImportsController()->Master()->FirstPartyForCookies(); |
4909 | 4909 |
4910 if (!GetFrame()) | 4910 if (!GetFrame()) |
4911 return SecurityOrigin::UrlWithUniqueSecurityOrigin(); | 4911 return SecurityOrigin::UrlWithUniqueSecurityOrigin(); |
4912 | 4912 |
4913 // TODO(mkwst): This doesn't correctly handle sandboxed documents; we want to | 4913 // TODO(mkwst): This doesn't correctly handle sandboxed documents; we want to |
4914 // look at their URL, but we can't because we don't know what it is. | 4914 // look at their URL, but we can't because we don't know what it is. |
4915 Frame* top = GetFrame()->Tree().Top(); | 4915 Frame& top = GetFrame()->Tree().Top(); |
4916 KURL top_document_url = | 4916 KURL top_document_url = |
4917 top->IsLocalFrame() | 4917 top.IsLocalFrame() |
4918 ? ToLocalFrame(top)->GetDocument()->Url() | 4918 ? ToLocalFrame(top).GetDocument()->Url() |
4919 : KURL(KURL(), | 4919 : KURL(KURL(), |
4920 top->GetSecurityContext()->GetSecurityOrigin()->ToString()); | 4920 top.GetSecurityContext()->GetSecurityOrigin()->ToString()); |
4921 if (SchemeRegistry::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel( | 4921 if (SchemeRegistry::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel( |
4922 top_document_url.Protocol())) | 4922 top_document_url.Protocol())) |
4923 return top_document_url; | 4923 return top_document_url; |
4924 | 4924 |
4925 // We're intentionally using the URL of each document rather than the | 4925 // We're intentionally using the URL of each document rather than the |
4926 // document's SecurityOrigin. Sandboxing a document into a unique origin | 4926 // document's SecurityOrigin. Sandboxing a document into a unique origin |
4927 // shouldn't effect first-/third-party status for cookies and site data. | 4927 // shouldn't effect first-/third-party status for cookies and site data. |
4928 const OriginAccessEntry& access_entry = | 4928 const OriginAccessEntry& access_entry = |
4929 top->IsLocalFrame() | 4929 top.IsLocalFrame() |
4930 ? ToLocalFrame(top)->GetDocument()->AccessEntryFromURL() | 4930 ? ToLocalFrame(top).GetDocument()->AccessEntryFromURL() |
4931 : OriginAccessEntry(top_document_url.Protocol(), | 4931 : OriginAccessEntry(top_document_url.Protocol(), |
4932 top_document_url.Host(), | 4932 top_document_url.Host(), |
4933 OriginAccessEntry::kAllowRegisterableDomains); | 4933 OriginAccessEntry::kAllowRegisterableDomains); |
4934 const Frame* current_frame = GetFrame(); | 4934 const Frame* current_frame = GetFrame(); |
4935 while (current_frame) { | 4935 while (current_frame) { |
4936 // Skip over srcdoc documents, as they are always same-origin with their | 4936 // Skip over srcdoc documents, as they are always same-origin with their |
4937 // closest non-srcdoc parent. | 4937 // closest non-srcdoc parent. |
4938 while (current_frame->IsLocalFrame() && | 4938 while (current_frame->IsLocalFrame() && |
4939 ToLocalFrame(current_frame)->GetDocument()->IsSrcdocDocument()) | 4939 ToLocalFrame(current_frame)->GetDocument()->IsSrcdocDocument()) |
4940 current_frame = current_frame->Tree().Parent(); | 4940 current_frame = current_frame->Tree().Parent(); |
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6779 } | 6779 } |
6780 | 6780 |
6781 void showLiveDocumentInstances() { | 6781 void showLiveDocumentInstances() { |
6782 WeakDocumentSet& set = liveDocumentSet(); | 6782 WeakDocumentSet& set = liveDocumentSet(); |
6783 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6783 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6784 for (blink::Document* document : set) | 6784 for (blink::Document* document : set) |
6785 fprintf(stderr, "- Document %p URL: %s\n", document, | 6785 fprintf(stderr, "- Document %p URL: %s\n", document, |
6786 document->Url().GetString().Utf8().data()); | 6786 document->Url().GetString().Utf8().data()); |
6787 } | 6787 } |
6788 #endif | 6788 #endif |
OLD | NEW |