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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 | 76 |
77 void setInsecureRequestsPolicy(InsecureRequestsPolicy policy) { m_insecureRe questsPolicy = policy; } | 77 void setInsecureRequestsPolicy(InsecureRequestsPolicy policy) { m_insecureRe questsPolicy = policy; } |
78 InsecureRequestsPolicy insecureRequestsPolicy() const { return m_insecureReq uestsPolicy; } | 78 InsecureRequestsPolicy insecureRequestsPolicy() const { return m_insecureReq uestsPolicy; } |
79 | 79 |
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 void setIsPotentiallyTrustworthySandboxedOrigin() { m_isPotentiallyTrustwort hySandboxedOrigin = true; } | |
87 // Returns true if this context is a sandboxed unique origin that should be considered potentially trustworthy. | |
88 bool isPotentiallyTrustworthySandboxedOrigin() const { return m_isPotentiall yTrustworthySandboxedOrigin; } | |
Mike West
2016/02/24 08:40:59
Did you consider putting this information into Sec
estark
2016/02/24 21:59:52
That seems reasonable. I moved these same flags on
| |
89 | |
90 // Returns true if this context is a sandboxed unique origin for which the s ecure context check should be bypassed. | |
91 bool bypassSecureContextCheckForSandboxedOrigin() const { return m_bypassSec ureContextCheckForSandboxedOrigin; } | |
92 | |
86 protected: | 93 protected: |
87 SecurityContext(); | 94 SecurityContext(); |
88 virtual ~SecurityContext(); | 95 virtual ~SecurityContext(); |
89 | 96 |
90 void setContentSecurityPolicy(PassRefPtrWillBeRawPtr<ContentSecurityPolicy>) ; | 97 void setContentSecurityPolicy(PassRefPtrWillBeRawPtr<ContentSecurityPolicy>) ; |
91 | 98 |
92 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin = false; } | 99 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin = false; } |
93 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit yOrigin; } | 100 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit yOrigin; } |
94 | 101 |
95 private: | 102 private: |
96 bool m_haveInitializedSecurityOrigin; | 103 bool m_haveInitializedSecurityOrigin; |
97 RefPtr<SecurityOrigin> m_securityOrigin; | 104 RefPtr<SecurityOrigin> m_securityOrigin; |
98 RefPtrWillBeMember<ContentSecurityPolicy> m_contentSecurityPolicy; | 105 RefPtrWillBeMember<ContentSecurityPolicy> m_contentSecurityPolicy; |
99 | 106 |
100 SandboxFlags m_sandboxFlags; | 107 SandboxFlags m_sandboxFlags; |
101 | 108 |
102 bool m_hostedInReservedIPRange; | 109 bool m_hostedInReservedIPRange; |
103 InsecureRequestsPolicy m_insecureRequestsPolicy; | 110 InsecureRequestsPolicy m_insecureRequestsPolicy; |
104 InsecureNavigationsSet m_insecureNavigationsToUpgrade; | 111 InsecureNavigationsSet m_insecureNavigationsToUpgrade; |
105 bool m_enforceStrictMixedContentChecking; | 112 bool m_enforceStrictMixedContentChecking; |
113 bool m_isPotentiallyTrustworthySandboxedOrigin; | |
114 bool m_bypassSecureContextCheckForSandboxedOrigin; | |
106 }; | 115 }; |
107 | 116 |
108 } // namespace blink | 117 } // namespace blink |
109 | 118 |
110 #endif // SecurityContext_h | 119 #endif // SecurityContext_h |
OLD | NEW |