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

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

Issue 978323002: Upgrade insecure requests: Pipe navigational hosts down into nested documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/fetch/ResourceFetcher.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 7631aa8d0a4a236ec8c0ee86f2217b1561abf5db..6538a4fe91ed4ec068bc57b292c8c9a4aeee605e 100644
--- a/Source/core/dom/SecurityContext.h
+++ b/Source/core/dom/SecurityContext.h
@@ -28,8 +28,10 @@
#define SecurityContext_h
#include "core/dom/SandboxFlags.h"
+#include "wtf/HashSet.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefPtr.h"
+#include "wtf/text/StringHash.h"
#include "wtf/text/WTFString.h"
namespace blink {
@@ -40,6 +42,8 @@ class KURL;
class SecurityContext {
public:
+ using InsecureNavigationsSet = HashSet<unsigned, WTF::AlreadyHashed>;
+
// The ordering here is important: 'Upgrade' overrides 'DoNotUpgrade'.
enum InsecureRequestsPolicy {
InsecureRequestsDoNotUpgrade = 0,
@@ -67,6 +71,10 @@ public:
void setInsecureRequestsPolicy(InsecureRequestsPolicy policy) { m_insecureRequestsPolicy = policy; }
InsecureRequestsPolicy insecureRequestsPolicy() const { return m_insecureRequestsPolicy; }
+ void addInsecureNavigationUpgrade(const String& host) { m_insecureNavigationsToUpgrade.add(host.impl()->hash()); }
+ void addInsecureNavigationUpgrade(unsigned hashedHost) { m_insecureNavigationsToUpgrade.add(hashedHost); }
+ InsecureNavigationsSet* insecureNavigationsToUpgrade() { return &m_insecureNavigationsToUpgrade; }
+
protected:
SecurityContext();
virtual ~SecurityContext();
@@ -85,6 +93,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/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698