| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // Explicitly override the security origin for this security context. | 63 // Explicitly override the security origin for this security context. |
| 64 // Note: It is dangerous to change the security origin of a script context | 64 // Note: It is dangerous to change the security origin of a script context |
| 65 // that already contains content. | 65 // that already contains content. |
| 66 void setSecurityOrigin(PassRefPtr<SecurityOrigin>); | 66 void setSecurityOrigin(PassRefPtr<SecurityOrigin>); |
| 67 virtual void didUpdateSecurityOrigin() = 0; | 67 virtual void didUpdateSecurityOrigin() = 0; |
| 68 | 68 |
| 69 SandboxFlags getSandboxFlags() const { return m_sandboxFlags; } | 69 SandboxFlags getSandboxFlags() const { return m_sandboxFlags; } |
| 70 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } | 70 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } |
| 71 void enforceSandboxFlags(SandboxFlags mask); | 71 void enforceSandboxFlags(SandboxFlags mask); |
| 72 | 72 |
| 73 void setHostedInReservedIPRange(bool value) { m_hostedInReservedIPRange = va
lue; } | 73 void setAddressSpace(WebURLRequest::AddressSpace space) { m_addressSpace = s
pace; } |
| 74 WebURLRequest::AddressSpace addressSpace() const; | 74 WebURLRequest::AddressSpace addressSpace() const { return m_addressSpace; } |
| 75 | 75 |
| 76 void setInsecureRequestsPolicy(InsecureRequestsPolicy policy) { m_insecureRe
questsPolicy = policy; } | 76 void setInsecureRequestsPolicy(InsecureRequestsPolicy policy) { m_insecureRe
questsPolicy = policy; } |
| 77 InsecureRequestsPolicy getInsecureRequestsPolicy() const { return m_insecure
RequestsPolicy; } | 77 InsecureRequestsPolicy getInsecureRequestsPolicy() const { return m_insecure
RequestsPolicy; } |
| 78 | 78 |
| 79 void addInsecureNavigationUpgrade(unsigned hashedHost) { m_insecureNavigatio
nsToUpgrade.add(hashedHost); } | 79 void addInsecureNavigationUpgrade(unsigned hashedHost) { m_insecureNavigatio
nsToUpgrade.add(hashedHost); } |
| 80 InsecureNavigationsSet* insecureNavigationsToUpgrade() { return &m_insecureN
avigationsToUpgrade; } | 80 InsecureNavigationsSet* insecureNavigationsToUpgrade() { return &m_insecureN
avigationsToUpgrade; } |
| 81 | 81 |
| 82 void setShouldEnforceStrictMixedContentChecking(bool shouldEnforce) { m_enfo
rceStrictMixedContentChecking = shouldEnforce; } | 82 void setShouldEnforceStrictMixedContentChecking(bool shouldEnforce) { m_enfo
rceStrictMixedContentChecking = shouldEnforce; } |
| 83 bool shouldEnforceStrictMixedContentChecking() { return m_enforceStrictMixed
ContentChecking; } | 83 bool shouldEnforceStrictMixedContentChecking() { return m_enforceStrictMixed
ContentChecking; } |
| 84 | 84 |
| 85 protected: | 85 protected: |
| 86 SecurityContext(); | 86 SecurityContext(); |
| 87 virtual ~SecurityContext(); | 87 virtual ~SecurityContext(); |
| 88 | 88 |
| 89 void setContentSecurityPolicy(PassRefPtrWillBeRawPtr<ContentSecurityPolicy>)
; | 89 void setContentSecurityPolicy(PassRefPtrWillBeRawPtr<ContentSecurityPolicy>)
; |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 RefPtr<SecurityOrigin> m_securityOrigin; | 92 RefPtr<SecurityOrigin> m_securityOrigin; |
| 93 RefPtrWillBeMember<ContentSecurityPolicy> m_contentSecurityPolicy; | 93 RefPtrWillBeMember<ContentSecurityPolicy> m_contentSecurityPolicy; |
| 94 | 94 |
| 95 SandboxFlags m_sandboxFlags; | 95 SandboxFlags m_sandboxFlags; |
| 96 | 96 |
| 97 bool m_hostedInReservedIPRange; | 97 WebURLRequest::AddressSpace m_addressSpace; |
| 98 InsecureRequestsPolicy m_insecureRequestsPolicy; | 98 InsecureRequestsPolicy m_insecureRequestsPolicy; |
| 99 InsecureNavigationsSet m_insecureNavigationsToUpgrade; | 99 InsecureNavigationsSet m_insecureNavigationsToUpgrade; |
| 100 bool m_enforceStrictMixedContentChecking; | 100 bool m_enforceStrictMixedContentChecking; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace blink | 103 } // namespace blink |
| 104 | 104 |
| 105 #endif // SecurityContext_h | 105 #endif // SecurityContext_h |
| OLD | NEW |