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

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

Issue 845303003: Tag SecurityContext objects as being hosted in reserved IP ranges. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Skip 'about:blank', 'swappedout://', etc. Created 5 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 | Source/core/dom/DocumentInit.h » ('j') | Source/core/dom/DocumentInit.cpp » ('J')
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 4658 matching lines...) Expand 10 before | Expand all | Expand 10 after
4669 initSecurityContext(DocumentInit(m_url, m_frame, contextDocument(), m_import sController)); 4669 initSecurityContext(DocumentInit(m_url, m_frame, contextDocument(), m_import sController));
4670 } 4670 }
4671 4671
4672 void Document::initSecurityContext(const DocumentInit& initializer) 4672 void Document::initSecurityContext(const DocumentInit& initializer)
4673 { 4673 {
4674 if (haveInitializedSecurityOrigin()) { 4674 if (haveInitializedSecurityOrigin()) {
4675 ASSERT(securityOrigin()); 4675 ASSERT(securityOrigin());
4676 return; 4676 return;
4677 } 4677 }
4678 4678
4679 if (initializer.isHostedInReservedIPRange())
4680 setHostedInReservedIPRange();
4681
4679 if (!initializer.hasSecurityContext()) { 4682 if (!initializer.hasSecurityContext()) {
4680 // No source for a security context. 4683 // No source for a security context.
4681 // This can occur via document.implementation.createDocument(). 4684 // This can occur via document.implementation.createDocument().
4682 m_cookieURL = KURL(ParsedURLString, emptyString()); 4685 m_cookieURL = KURL(ParsedURLString, emptyString());
4683 setSecurityOrigin(SecurityOrigin::createUnique()); 4686 setSecurityOrigin(SecurityOrigin::createUnique());
4684 initContentSecurityPolicy(); 4687 initContentSecurityPolicy();
4685 return; 4688 return;
4686 } 4689 }
4687 4690
4688 // In the common case, create the security context from the currently 4691 // In the common case, create the security context from the currently
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
5758 #ifndef NDEBUG 5761 #ifndef NDEBUG
5759 using namespace blink; 5762 using namespace blink;
5760 void showLiveDocumentInstances() 5763 void showLiveDocumentInstances()
5761 { 5764 {
5762 WeakDocumentSet& set = liveDocumentSet(); 5765 WeakDocumentSet& set = liveDocumentSet();
5763 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5766 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5764 for (Document* document : set) 5767 for (Document* document : set)
5765 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5768 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5766 } 5769 }
5767 #endif 5770 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/DocumentInit.h » ('j') | Source/core/dom/DocumentInit.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698