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

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: Feedback. 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') | 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 4662 matching lines...) Expand 10 before | Expand all | Expand 10 after
4673 initSecurityContext(DocumentInit(m_url, m_frame, contextDocument(), m_import sController)); 4673 initSecurityContext(DocumentInit(m_url, m_frame, contextDocument(), m_import sController));
4674 } 4674 }
4675 4675
4676 void Document::initSecurityContext(const DocumentInit& initializer) 4676 void Document::initSecurityContext(const DocumentInit& initializer)
4677 { 4677 {
4678 if (haveInitializedSecurityOrigin()) { 4678 if (haveInitializedSecurityOrigin()) {
4679 ASSERT(securityOrigin()); 4679 ASSERT(securityOrigin());
4680 return; 4680 return;
4681 } 4681 }
4682 4682
4683 if (initializer.isHostedInReservedIPRange())
4684 setHostedInReservedIPRange();
4685
4683 if (!initializer.hasSecurityContext()) { 4686 if (!initializer.hasSecurityContext()) {
4684 // No source for a security context. 4687 // No source for a security context.
4685 // This can occur via document.implementation.createDocument(). 4688 // This can occur via document.implementation.createDocument().
4686 m_cookieURL = KURL(ParsedURLString, emptyString()); 4689 m_cookieURL = KURL(ParsedURLString, emptyString());
4687 setSecurityOrigin(SecurityOrigin::createUnique()); 4690 setSecurityOrigin(SecurityOrigin::createUnique());
4688 initContentSecurityPolicy(); 4691 initContentSecurityPolicy();
4689 return; 4692 return;
4690 } 4693 }
4691 4694
4692 // In the common case, create the security context from the currently 4695 // In the common case, create the security context from the currently
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
5762 #ifndef NDEBUG 5765 #ifndef NDEBUG
5763 using namespace blink; 5766 using namespace blink;
5764 void showLiveDocumentInstances() 5767 void showLiveDocumentInstances()
5765 { 5768 {
5766 WeakDocumentSet& set = liveDocumentSet(); 5769 WeakDocumentSet& set = liveDocumentSet();
5767 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5770 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5768 for (Document* document : set) 5771 for (Document* document : set)
5769 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5772 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5770 } 5773 }
5771 #endif 5774 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/DocumentInit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698