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

Unified Diff: Source/core/dom/SecurityContext.h

Issue 1010893003: Upgrade insecure requests: Pipe navigational hosts down into nested documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: MOARASSERT Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DocumentInit.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/SecurityContext.h
diff --git a/Source/core/dom/SecurityContext.h b/Source/core/dom/SecurityContext.h
index 56506812c78539bee582e4631784254e79002b53..a0d55501c486281e4b04318fbf32e0c5b7180632 100644
--- a/Source/core/dom/SecurityContext.h
+++ b/Source/core/dom/SecurityContext.h
@@ -29,9 +29,11 @@
#include "core/CoreExport.h"
#include "core/dom/SandboxFlags.h"
+#include "wtf/HashSet.h"
#include "wtf/Noncopyable.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefPtr.h"
+#include "wtf/text/StringHash.h"
#include "wtf/text/WTFString.h"
namespace blink {
@@ -43,6 +45,8 @@ class KURL;
class CORE_EXPORT SecurityContext {
WTF_MAKE_NONCOPYABLE(SecurityContext);
public:
+ using InsecureNavigationsSet = HashSet<unsigned, WTF::AlreadyHashed>;
+
// The ordering here is important: 'Upgrade' overrides 'DoNotUpgrade'.
enum InsecureRequestsPolicy {
InsecureRequestsDoNotUpgrade = 0,
@@ -70,6 +74,9 @@ public:
void setInsecureRequestsPolicy(InsecureRequestsPolicy policy) { m_insecureRequestsPolicy = policy; }
InsecureRequestsPolicy insecureRequestsPolicy() const { return m_insecureRequestsPolicy; }
+ void addInsecureNavigationUpgrade(unsigned hashedHost) { m_insecureNavigationsToUpgrade.add(hashedHost); }
+ InsecureNavigationsSet* insecureNavigationsToUpgrade() { return &m_insecureNavigationsToUpgrade; }
+
protected:
SecurityContext();
virtual ~SecurityContext();
@@ -88,6 +95,7 @@ private:
bool m_hostedInReservedIPRange;
InsecureRequestsPolicy m_insecureRequestsPolicy;
+ InsecureNavigationsSet m_insecureNavigationsToUpgrade;
};
} // namespace blink
« no previous file with comments | « Source/core/dom/DocumentInit.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698