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

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

Issue 845303003: Tag SecurityContext objects as being hosted in reserved IP ranges. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Skip 'about:blank', 'swappedout://', etc. Created 5 years, 11 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
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Explicitly override the security origin for this security context. 48 // Explicitly override the security origin for this security context.
49 // Note: It is dangerous to change the security origin of a script context 49 // Note: It is dangerous to change the security origin of a script context
50 // that already contains content. 50 // that already contains content.
51 void setSecurityOrigin(PassRefPtr<SecurityOrigin>); 51 void setSecurityOrigin(PassRefPtr<SecurityOrigin>);
52 virtual void didUpdateSecurityOrigin() = 0; 52 virtual void didUpdateSecurityOrigin() = 0;
53 53
54 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } 54 SandboxFlags sandboxFlags() const { return m_sandboxFlags; }
55 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } 55 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; }
56 void enforceSandboxFlags(SandboxFlags mask); 56 void enforceSandboxFlags(SandboxFlags mask);
57 57
58 void setHostedInReservedIPRange() { m_hostedInReservedIPRange = true; }
59 bool isHostedInReservedIPRange() { return m_hostedInReservedIPRange; }
jochen (gone - plz use gerrit) 2015/01/13 15:04:55 const
60
58 protected: 61 protected:
59 SecurityContext(); 62 SecurityContext();
60 virtual ~SecurityContext(); 63 virtual ~SecurityContext();
61 64
62 void setContentSecurityPolicy(PassRefPtr<ContentSecurityPolicy>); 65 void setContentSecurityPolicy(PassRefPtr<ContentSecurityPolicy>);
63 66
64 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin = false; } 67 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin = false; }
65 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit yOrigin; } 68 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit yOrigin; }
66 69
67 private: 70 private:
68 bool m_haveInitializedSecurityOrigin; 71 bool m_haveInitializedSecurityOrigin;
69 RefPtr<SecurityOrigin> m_securityOrigin; 72 RefPtr<SecurityOrigin> m_securityOrigin;
70 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy; 73 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy;
71 74
72 SandboxFlags m_sandboxFlags; 75 SandboxFlags m_sandboxFlags;
76
77 bool m_hostedInReservedIPRange;
73 }; 78 };
74 79
75 } // namespace blink 80 } // namespace blink
76 81
77 #endif // SecurityContext_h 82 #endif // SecurityContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698