| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "wtf/RefPtr.h" | 36 #include "wtf/RefPtr.h" |
| 37 #include "wtf/text/StringHash.h" | 37 #include "wtf/text/StringHash.h" |
| 38 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class SecurityOrigin; | 42 class SecurityOrigin; |
| 43 class ContentSecurityPolicy; | 43 class ContentSecurityPolicy; |
| 44 class KURL; | 44 class KURL; |
| 45 | 45 |
| 46 class CORE_EXPORT SecurityContext : public WillBeGarbageCollectedMixin { | 46 class CORE_EXPORT SecurityContext : public GarbageCollectedMixin { |
| 47 WTF_MAKE_NONCOPYABLE(SecurityContext); | 47 WTF_MAKE_NONCOPYABLE(SecurityContext); |
| 48 public: | 48 public: |
| 49 DECLARE_VIRTUAL_TRACE(); | 49 DECLARE_VIRTUAL_TRACE(); |
| 50 | 50 |
| 51 using InsecureNavigationsSet = HashSet<unsigned, WTF::AlreadyHashed>; | 51 using InsecureNavigationsSet = HashSet<unsigned, WTF::AlreadyHashed>; |
| 52 | 52 |
| 53 // The ordering here is important: 'Upgrade' overrides 'DoNotUpgrade'. | 53 // The ordering here is important: 'Upgrade' overrides 'DoNotUpgrade'. |
| 54 enum InsecureRequestsPolicy { | 54 enum InsecureRequestsPolicy { |
| 55 InsecureRequestsDoNotUpgrade = 0, | 55 InsecureRequestsDoNotUpgrade = 0, |
| 56 InsecureRequestsUpgrade | 56 InsecureRequestsUpgrade |
| (...skipping 23 matching lines...) Expand all Loading... |
| 80 void addInsecureNavigationUpgrade(unsigned hashedHost) { m_insecureNavigatio
nsToUpgrade.add(hashedHost); } | 80 void addInsecureNavigationUpgrade(unsigned hashedHost) { m_insecureNavigatio
nsToUpgrade.add(hashedHost); } |
| 81 InsecureNavigationsSet* insecureNavigationsToUpgrade() { return &m_insecureN
avigationsToUpgrade; } | 81 InsecureNavigationsSet* insecureNavigationsToUpgrade() { return &m_insecureN
avigationsToUpgrade; } |
| 82 | 82 |
| 83 void setShouldEnforceStrictMixedContentChecking(bool shouldEnforce) { m_enfo
rceStrictMixedContentChecking = shouldEnforce; } | 83 void setShouldEnforceStrictMixedContentChecking(bool shouldEnforce) { m_enfo
rceStrictMixedContentChecking = shouldEnforce; } |
| 84 bool shouldEnforceStrictMixedContentChecking() { return m_enforceStrictMixed
ContentChecking; } | 84 bool shouldEnforceStrictMixedContentChecking() { return m_enforceStrictMixed
ContentChecking; } |
| 85 | 85 |
| 86 protected: | 86 protected: |
| 87 SecurityContext(); | 87 SecurityContext(); |
| 88 virtual ~SecurityContext(); | 88 virtual ~SecurityContext(); |
| 89 | 89 |
| 90 void setContentSecurityPolicy(PassRefPtrWillBeRawPtr<ContentSecurityPolicy>)
; | 90 void setContentSecurityPolicy(RawPtr<ContentSecurityPolicy>); |
| 91 | 91 |
| 92 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin =
false; } | 92 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin =
false; } |
| 93 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit
yOrigin; } | 93 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit
yOrigin; } |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 bool m_haveInitializedSecurityOrigin; | 96 bool m_haveInitializedSecurityOrigin; |
| 97 RefPtr<SecurityOrigin> m_securityOrigin; | 97 RefPtr<SecurityOrigin> m_securityOrigin; |
| 98 RefPtrWillBeMember<ContentSecurityPolicy> m_contentSecurityPolicy; | 98 Member<ContentSecurityPolicy> m_contentSecurityPolicy; |
| 99 | 99 |
| 100 SandboxFlags m_sandboxFlags; | 100 SandboxFlags m_sandboxFlags; |
| 101 | 101 |
| 102 bool m_hostedInReservedIPRange; | 102 bool m_hostedInReservedIPRange; |
| 103 InsecureRequestsPolicy m_insecureRequestsPolicy; | 103 InsecureRequestsPolicy m_insecureRequestsPolicy; |
| 104 InsecureNavigationsSet m_insecureNavigationsToUpgrade; | 104 InsecureNavigationsSet m_insecureNavigationsToUpgrade; |
| 105 bool m_enforceStrictMixedContentChecking; | 105 bool m_enforceStrictMixedContentChecking; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace blink | 108 } // namespace blink |
| 109 | 109 |
| 110 #endif // SecurityContext_h | 110 #endif // SecurityContext_h |
| OLD | NEW |