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

Side by Side Diff: Source/core/dom/SecurityContext.h

Issue 980213002: Rename InsecureContentPolicy to InsecureRequestsPolicy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/DocumentInit.cpp ('k') | Source/core/dom/SecurityContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 22 matching lines...) Expand all
33 #include "wtf/text/WTFString.h" 33 #include "wtf/text/WTFString.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class SecurityOrigin; 37 class SecurityOrigin;
38 class ContentSecurityPolicy; 38 class ContentSecurityPolicy;
39 class KURL; 39 class KURL;
40 40
41 class SecurityContext { 41 class SecurityContext {
42 public: 42 public:
43 // The ordering here is important: 'Upgrade' overrides 'Monitor', which over rides 'DoNotUpgrade'. 43 // The ordering here is important: 'Upgrade' overrides 'DoNotUpgrade'.
44 enum InsecureContentPolicy { 44 enum InsecureRequestsPolicy {
45 InsecureContentDoNotUpgrade = 0, 45 InsecureRequestsDoNotUpgrade = 0,
46 InsecureContentUpgrade 46 InsecureRequestsUpgrade
47 }; 47 };
48 48
49 SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); } 49 SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }
50 ContentSecurityPolicy* contentSecurityPolicy() const { return m_contentSecur ityPolicy.get(); } 50 ContentSecurityPolicy* contentSecurityPolicy() const { return m_contentSecur ityPolicy.get(); }
51 51
52 bool isSecureTransitionTo(const KURL&) const; 52 bool isSecureTransitionTo(const KURL&) const;
53 53
54 // Explicitly override the security origin for this security context. 54 // Explicitly override the security origin for this security context.
55 // Note: It is dangerous to change the security origin of a script context 55 // Note: It is dangerous to change the security origin of a script context
56 // that already contains content. 56 // that already contains content.
57 void setSecurityOrigin(PassRefPtr<SecurityOrigin>); 57 void setSecurityOrigin(PassRefPtr<SecurityOrigin>);
58 virtual void didUpdateSecurityOrigin() = 0; 58 virtual void didUpdateSecurityOrigin() = 0;
59 59
60 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } 60 SandboxFlags sandboxFlags() const { return m_sandboxFlags; }
61 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } 61 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; }
62 void enforceSandboxFlags(SandboxFlags mask); 62 void enforceSandboxFlags(SandboxFlags mask);
63 63
64 void setHostedInReservedIPRange() { m_hostedInReservedIPRange = true; } 64 void setHostedInReservedIPRange() { m_hostedInReservedIPRange = true; }
65 bool isHostedInReservedIPRange() const { return m_hostedInReservedIPRange; } 65 bool isHostedInReservedIPRange() const { return m_hostedInReservedIPRange; }
66 66
67 void setInsecureContentPolicy(InsecureContentPolicy policy) { m_insecureCont entPolicy = policy; } 67 void setInsecureRequestsPolicy(InsecureRequestsPolicy policy) { m_insecureRe questsPolicy = policy; }
68 InsecureContentPolicy insecureContentPolicy() const { return m_insecureConte ntPolicy; } 68 InsecureRequestsPolicy insecureRequestsPolicy() const { return m_insecureReq uestsPolicy; }
69 69
70 protected: 70 protected:
71 SecurityContext(); 71 SecurityContext();
72 virtual ~SecurityContext(); 72 virtual ~SecurityContext();
73 73
74 void setContentSecurityPolicy(PassRefPtr<ContentSecurityPolicy>); 74 void setContentSecurityPolicy(PassRefPtr<ContentSecurityPolicy>);
75 75
76 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin = false; } 76 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin = false; }
77 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit yOrigin; } 77 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit yOrigin; }
78 78
79 private: 79 private:
80 bool m_haveInitializedSecurityOrigin; 80 bool m_haveInitializedSecurityOrigin;
81 RefPtr<SecurityOrigin> m_securityOrigin; 81 RefPtr<SecurityOrigin> m_securityOrigin;
82 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy; 82 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy;
83 83
84 SandboxFlags m_sandboxFlags; 84 SandboxFlags m_sandboxFlags;
85 85
86 bool m_hostedInReservedIPRange; 86 bool m_hostedInReservedIPRange;
87 InsecureContentPolicy m_insecureContentPolicy; 87 InsecureRequestsPolicy m_insecureRequestsPolicy;
88 }; 88 };
89 89
90 } // namespace blink 90 } // namespace blink
91 91
92 #endif // SecurityContext_h 92 #endif // SecurityContext_h
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentInit.cpp ('k') | Source/core/dom/SecurityContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698