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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1607243002: Add 'OriginAccessEntry::matchDomain'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 4142 matching lines...) Expand 10 before | Expand all | Expand 10 after
4153 // Sandboxing a document into a unique origin shouldn't effect first-/third- party status for 4153 // Sandboxing a document into a unique origin shouldn't effect first-/third- party status for
4154 // cookies and site data. 4154 // cookies and site data.
4155 const OriginAccessEntry& accessEntry = topDocument().accessEntryFromURL(); 4155 const OriginAccessEntry& accessEntry = topDocument().accessEntryFromURL();
4156 const Document* currentDocument = this; 4156 const Document* currentDocument = this;
4157 while (currentDocument) { 4157 while (currentDocument) {
4158 // Skip over srcdoc documents, as they are always same-origin with their closest non-srcdoc parent. 4158 // Skip over srcdoc documents, as they are always same-origin with their closest non-srcdoc parent.
4159 while (currentDocument->isSrcdocDocument()) 4159 while (currentDocument->isSrcdocDocument())
4160 currentDocument = currentDocument->parentDocument(); 4160 currentDocument = currentDocument->parentDocument();
4161 ASSERT(currentDocument); 4161 ASSERT(currentDocument);
4162 4162
4163 if (accessEntry.matchesOrigin(*currentDocument->securityOrigin()) == Ori ginAccessEntry::DoesNotMatchOrigin) 4163 // We use 'matchesDomain' here, as it turns out that some folks embed HT TPS login forms
4164 // into HTTP pages; we should allow this kind of upgrade.
4165 if (accessEntry.matchesDomain(*currentDocument->securityOrigin()) == Ori ginAccessEntry::DoesNotMatchOrigin)
4164 return SecurityOrigin::urlWithUniqueSecurityOrigin(); 4166 return SecurityOrigin::urlWithUniqueSecurityOrigin();
4165 4167
4166 currentDocument = currentDocument->parentDocument(); 4168 currentDocument = currentDocument->parentDocument();
4167 } 4169 }
4168 4170
4169 return topDocument().url(); 4171 return topDocument().url();
4170 } 4172 }
4171 4173
4172 static bool isValidNameNonASCII(const LChar* characters, unsigned length) 4174 static bool isValidNameNonASCII(const LChar* characters, unsigned length)
4173 { 4175 {
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after
5914 #ifndef NDEBUG 5916 #ifndef NDEBUG
5915 using namespace blink; 5917 using namespace blink;
5916 void showLiveDocumentInstances() 5918 void showLiveDocumentInstances()
5917 { 5919 {
5918 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5920 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5919 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5921 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5920 for (Document* document : set) 5922 for (Document* document : set)
5921 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5923 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5922 } 5924 }
5923 #endif 5925 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698