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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2040133003: Replace SecurityContext::InsecureRequestsPolicy with WebInsecureRequestPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@combine-uir-block
Patch Set: Ugh. 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 { 1564 {
1565 SandboxFlags flags = m_forcedSandboxFlags; 1565 SandboxFlags flags = m_forcedSandboxFlags;
1566 if (FrameOwner* frameOwner = m_frame->owner()) 1566 if (FrameOwner* frameOwner = m_frame->owner())
1567 flags |= frameOwner->getSandboxFlags(); 1567 flags |= frameOwner->getSandboxFlags();
1568 // Frames need to inherit the sandbox flags of their parent frame. 1568 // Frames need to inherit the sandbox flags of their parent frame.
1569 if (Frame* parentFrame = m_frame->tree().parent()) 1569 if (Frame* parentFrame = m_frame->tree().parent())
1570 flags |= parentFrame->securityContext()->getSandboxFlags(); 1570 flags |= parentFrame->securityContext()->getSandboxFlags();
1571 return flags; 1571 return flags;
1572 } 1572 }
1573 1573
1574 bool FrameLoader::shouldEnforceStrictMixedContentChecking() const 1574 WebInsecureRequestPolicy FrameLoader::getInsecureRequestPolicy() const
1575 { 1575 {
1576 Frame* parentFrame = m_frame->tree().parent(); 1576 Frame* parentFrame = m_frame->tree().parent();
1577 if (!parentFrame) 1577 if (!parentFrame)
1578 return false; 1578 return kLeaveInsecureRequestsAlone;
1579 1579
1580 return parentFrame->securityContext()->shouldEnforceStrictMixedContentChecki ng(); 1580 return parentFrame->securityContext()->getInsecureRequestPolicy();
1581 }
1582
1583 SecurityContext::InsecureRequestsPolicy FrameLoader::getInsecureRequestsPolicy() const
1584 {
1585 Frame* parentFrame = m_frame->tree().parent();
1586 if (!parentFrame)
1587 return SecurityContext::InsecureRequestsDoNotUpgrade;
1588
1589 // FIXME: We need a way to propagate insecure requests policy flags to
1590 // out-of-process frames. For now, we'll always use default behavior.
1591 if (!parentFrame->isLocalFrame())
1592 return SecurityContext::InsecureRequestsDoNotUpgrade;
1593
1594 ASSERT(toLocalFrame(parentFrame)->document());
1595 return toLocalFrame(parentFrame)->document()->getInsecureRequestsPolicy();
1596 } 1581 }
1597 1582
1598 SecurityContext::InsecureNavigationsSet* FrameLoader::insecureNavigationsToUpgra de() const 1583 SecurityContext::InsecureNavigationsSet* FrameLoader::insecureNavigationsToUpgra de() const
1599 { 1584 {
1600 ASSERT(m_frame); 1585 ASSERT(m_frame);
1601 Frame* parentFrame = m_frame->tree().parent(); 1586 Frame* parentFrame = m_frame->tree().parent();
1602 if (!parentFrame) 1587 if (!parentFrame)
1603 return nullptr; 1588 return nullptr;
1604 1589
1605 // FIXME: We need a way to propagate insecure requests policy flags to 1590 // FIXME: We need a way to propagate insecure requests policy flags to
(...skipping 17 matching lines...) Expand all
1623 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String()); 1608 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String());
1624 return tracedValue; 1609 return tracedValue;
1625 } 1610 }
1626 1611
1627 inline void FrameLoader::takeObjectSnapshot() const 1612 inline void FrameLoader::takeObjectSnapshot() const
1628 { 1613 {
1629 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value()); 1614 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value());
1630 } 1615 }
1631 1616
1632 } // namespace blink 1617 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | third_party/WebKit/Source/core/loader/MixedContentChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698