| 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 12 matching lines...) Expand all Loading... |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 * | 24 * |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef SecurityContext_h | 27 #ifndef SecurityContext_h |
| 28 #define SecurityContext_h | 28 #define SecurityContext_h |
| 29 | 29 |
| 30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
| 31 #include "core/dom/SandboxFlags.h" | 31 #include "core/dom/SandboxFlags.h" |
| 32 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
| 33 #include "public/platform/WebURLRequest.h" |
| 33 #include "wtf/HashSet.h" | 34 #include "wtf/HashSet.h" |
| 34 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
| 35 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
| 36 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
| 37 #include "wtf/text/StringHash.h" | 38 #include "wtf/text/StringHash.h" |
| 38 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 42 class SecurityOrigin; | 43 class SecurityOrigin; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 64 // Explicitly override the security origin for this security context. | 65 // Explicitly override the security origin for this security context. |
| 65 // Note: It is dangerous to change the security origin of a script context | 66 // Note: It is dangerous to change the security origin of a script context |
| 66 // that already contains content. | 67 // that already contains content. |
| 67 void setSecurityOrigin(PassRefPtr<SecurityOrigin>); | 68 void setSecurityOrigin(PassRefPtr<SecurityOrigin>); |
| 68 virtual void didUpdateSecurityOrigin() = 0; | 69 virtual void didUpdateSecurityOrigin() = 0; |
| 69 | 70 |
| 70 SandboxFlags getSandboxFlags() const { return m_sandboxFlags; } | 71 SandboxFlags getSandboxFlags() const { return m_sandboxFlags; } |
| 71 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } | 72 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } |
| 72 void enforceSandboxFlags(SandboxFlags mask); | 73 void enforceSandboxFlags(SandboxFlags mask); |
| 73 | 74 |
| 74 void setHostedInReservedIPRange() { m_hostedInReservedIPRange = true; } | 75 void setHostedInReservedIPRange(bool value) { m_hostedInReservedIPRange = va
lue; } |
| 75 bool isHostedInReservedIPRange() const { return m_hostedInReservedIPRange; } | 76 WebURLRequest::AddressSpace addressSpace() const; |
| 76 | 77 |
| 77 void setInsecureRequestsPolicy(InsecureRequestsPolicy policy) { m_insecureRe
questsPolicy = policy; } | 78 void setInsecureRequestsPolicy(InsecureRequestsPolicy policy) { m_insecureRe
questsPolicy = policy; } |
| 78 InsecureRequestsPolicy getInsecureRequestsPolicy() const { return m_insecure
RequestsPolicy; } | 79 InsecureRequestsPolicy getInsecureRequestsPolicy() const { return m_insecure
RequestsPolicy; } |
| 79 | 80 |
| 80 void addInsecureNavigationUpgrade(unsigned hashedHost) { m_insecureNavigatio
nsToUpgrade.add(hashedHost); } | 81 void addInsecureNavigationUpgrade(unsigned hashedHost) { m_insecureNavigatio
nsToUpgrade.add(hashedHost); } |
| 81 InsecureNavigationsSet* insecureNavigationsToUpgrade() { return &m_insecureN
avigationsToUpgrade; } | 82 InsecureNavigationsSet* insecureNavigationsToUpgrade() { return &m_insecureN
avigationsToUpgrade; } |
| 82 | 83 |
| 83 void setShouldEnforceStrictMixedContentChecking(bool shouldEnforce) { m_enfo
rceStrictMixedContentChecking = shouldEnforce; } | 84 void setShouldEnforceStrictMixedContentChecking(bool shouldEnforce) { m_enfo
rceStrictMixedContentChecking = shouldEnforce; } |
| 84 bool shouldEnforceStrictMixedContentChecking() { return m_enforceStrictMixed
ContentChecking; } | 85 bool shouldEnforceStrictMixedContentChecking() { return m_enforceStrictMixed
ContentChecking; } |
| 85 | 86 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 101 | 102 |
| 102 bool m_hostedInReservedIPRange; | 103 bool m_hostedInReservedIPRange; |
| 103 InsecureRequestsPolicy m_insecureRequestsPolicy; | 104 InsecureRequestsPolicy m_insecureRequestsPolicy; |
| 104 InsecureNavigationsSet m_insecureNavigationsToUpgrade; | 105 InsecureNavigationsSet m_insecureNavigationsToUpgrade; |
| 105 bool m_enforceStrictMixedContentChecking; | 106 bool m_enforceStrictMixedContentChecking; |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 } // namespace blink | 109 } // namespace blink |
| 109 | 110 |
| 110 #endif // SecurityContext_h | 111 #endif // SecurityContext_h |
| OLD | NEW |