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

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

Issue 2040133003: Replace SecurityContext::InsecureRequestsPolicy with WebInsecureRequestPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@combine-uir-block
Patch Set: Created 4 years, 6 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
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 4884 matching lines...) Expand 10 before | Expand all | Expand 10 after
4895 m_cookieURL = KURL(ParsedURLString, emptyString()); 4895 m_cookieURL = KURL(ParsedURLString, emptyString());
4896 setSecurityOrigin(SecurityOrigin::createUnique()); 4896 setSecurityOrigin(SecurityOrigin::createUnique());
4897 initContentSecurityPolicy(); 4897 initContentSecurityPolicy();
4898 // Unique security origins cannot have a suborigin 4898 // Unique security origins cannot have a suborigin
4899 return; 4899 return;
4900 } 4900 }
4901 4901
4902 // In the common case, create the security context from the currently 4902 // In the common case, create the security context from the currently
4903 // loading URL with a fresh content security policy. 4903 // loading URL with a fresh content security policy.
4904 enforceSandboxFlags(initializer.getSandboxFlags()); 4904 enforceSandboxFlags(initializer.getSandboxFlags());
4905 if (initializer.shouldEnforceStrictMixedContentChecking()) 4905 enforceInsecureRequestPolicy(initializer.getInsecureRequestPolicy());
4906 enforceStrictMixedContentChecking();
4907 setInsecureRequestsPolicy(initializer.getInsecureRequestsPolicy());
4908 if (initializer.insecureNavigationsToUpgrade()) { 4906 if (initializer.insecureNavigationsToUpgrade()) {
4909 for (auto toUpgrade : *initializer.insecureNavigationsToUpgrade()) 4907 for (auto toUpgrade : *initializer.insecureNavigationsToUpgrade())
4910 addInsecureNavigationUpgrade(toUpgrade); 4908 addInsecureNavigationUpgrade(toUpgrade);
4911 } 4909 }
4912 4910
4913 if (isSandboxed(SandboxOrigin)) { 4911 if (isSandboxed(SandboxOrigin)) {
4914 m_cookieURL = m_url; 4912 m_cookieURL = m_url;
4915 setSecurityOrigin(SecurityOrigin::createUnique()); 4913 setSecurityOrigin(SecurityOrigin::createUnique());
4916 // If we're supposed to inherit our security origin from our 4914 // If we're supposed to inherit our security origin from our
4917 // owner, but we're also sandboxed, the only things we inherit are 4915 // owner, but we're also sandboxed, the only things we inherit are
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
5853 { 5851 {
5854 if (frame()) 5852 if (frame())
5855 return m_frame->frameScheduler()->timerTaskRunner(); 5853 return m_frame->frameScheduler()->timerTaskRunner();
5856 if (m_importsController) 5854 if (m_importsController)
5857 return m_importsController->master()->timerTaskRunner(); 5855 return m_importsController->master()->timerTaskRunner();
5858 if (m_contextDocument) 5856 if (m_contextDocument)
5859 return m_contextDocument->timerTaskRunner(); 5857 return m_contextDocument->timerTaskRunner();
5860 return Platform::current()->currentThread()->scheduler()->timerTaskRunner(); 5858 return Platform::current()->currentThread()->scheduler()->timerTaskRunner();
5861 } 5859 }
5862 5860
5863 void Document::enforceStrictMixedContentChecking() 5861 void Document::enforceInsecureRequestPolicy(WebInsecureRequestPolicy policy)
5864 { 5862 {
5865 securityContext().setShouldEnforceStrictMixedContentChecking(true); 5863 securityContext().setInsecureRequestPolicy(policy);
5866 if (frame()) 5864 if (frame() && policy & kBlockAllMixedContent)
5867 frame()->loader().client()->didEnforceStrictMixedContentChecking(); 5865 frame()->loader().client()->didEnforceStrictMixedContentChecking();
5868 } 5866 }
5869 5867
5870 void Document::setShadowCascadeOrder(ShadowCascadeOrder order) 5868 void Document::setShadowCascadeOrder(ShadowCascadeOrder order)
5871 { 5869 {
5872 DCHECK_NE(order, ShadowCascadeOrder::ShadowCascadeNone); 5870 DCHECK_NE(order, ShadowCascadeOrder::ShadowCascadeNone);
5873 5871
5874 if (order == m_shadowCascadeOrder) 5872 if (order == m_shadowCascadeOrder)
5875 return; 5873 return;
5876 5874
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
5983 #ifndef NDEBUG 5981 #ifndef NDEBUG
5984 using namespace blink; 5982 using namespace blink;
5985 void showLiveDocumentInstances() 5983 void showLiveDocumentInstances()
5986 { 5984 {
5987 WeakDocumentSet& set = liveDocumentSet(); 5985 WeakDocumentSet& set = liveDocumentSet();
5988 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5986 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5989 for (Document* document : set) 5987 for (Document* document : set)
5990 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 5988 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
5991 } 5989 }
5992 #endif 5990 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698