OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 return world(isolate->GetCurrentContext()); | 86 return world(isolate->GetCurrentContext()); |
87 } | 87 } |
88 | 88 |
89 static DOMWrapperWorld& mainWorld(); | 89 static DOMWrapperWorld& mainWorld(); |
90 | 90 |
91 // Associates an isolated world (see above for description) with a security | 91 // Associates an isolated world (see above for description) with a security |
92 // origin. XMLHttpRequest instances used in that world will be considered | 92 // origin. XMLHttpRequest instances used in that world will be considered |
93 // to come from that origin, not the frame's. | 93 // to come from that origin, not the frame's. |
94 static void setIsolatedWorldSecurityOrigin(int worldID, PassRefPtr<SecurityO
rigin>); | 94 static void setIsolatedWorldSecurityOrigin(int worldID, PassRefPtr<SecurityO
rigin>); |
95 static void clearIsolatedWorldSecurityOrigin(int worldID); | |
96 SecurityOrigin* isolatedWorldSecurityOrigin(); | 95 SecurityOrigin* isolatedWorldSecurityOrigin(); |
97 | 96 |
98 // Associated an isolated world with a Content Security Policy. Resources | 97 // Associated an isolated world with a Content Security Policy. Resources |
99 // embedded into the main world's DOM from script executed in an isolated | 98 // embedded into the main world's DOM from script executed in an isolated |
100 // world should be restricted based on the isolated world's DOM, not the | 99 // world should be restricted based on the isolated world's DOM, not the |
101 // main world's. | 100 // main world's. |
102 // | 101 // |
103 // FIXME: Right now, resource injection simply bypasses the main world's | 102 // FIXME: Right now, resource injection simply bypasses the main world's |
104 // DOM. More work is necessary to allow the isolated world's policy to be | 103 // DOM. More work is necessary to allow the isolated world's policy to be |
105 // applied correctly. | 104 // applied correctly. |
106 static void setIsolatedWorldContentSecurityPolicy(int worldID, const String&
policy); | 105 static void setIsolatedWorldContentSecurityPolicy(int worldID, const String&
policy); |
107 static void clearIsolatedWorldContentSecurityPolicy(int worldID); | |
108 bool isolatedWorldHasContentSecurityPolicy(); | 106 bool isolatedWorldHasContentSecurityPolicy(); |
109 | 107 |
110 bool isMainWorld() const { return m_worldId == MainWorldId; } | 108 bool isMainWorld() const { return m_worldId == MainWorldId; } |
111 bool isWorkerWorld() const { return m_worldId == WorkerWorldId; } | 109 bool isWorkerWorld() const { return m_worldId == WorkerWorldId; } |
112 bool isIsolatedWorld() const { return MainWorldId < m_worldId && m_worldId
< IsolatedWorldIdLimit; } | 110 bool isIsolatedWorld() const { return MainWorldId < m_worldId && m_worldId
< IsolatedWorldIdLimit; } |
113 | 111 |
114 int worldId() const { return m_worldId; } | 112 int worldId() const { return m_worldId; } |
115 int extensionGroup() const { return m_extensionGroup; } | 113 int extensionGroup() const { return m_extensionGroup; } |
116 DOMDataStore& domDataStore() { return *m_domDataStore; } | 114 DOMDataStore& domDataStore() { return *m_domDataStore; } |
117 | 115 |
(...skipping 12 matching lines...) Expand all Loading... |
130 static DOMWrapperWorld* worldOfInitializingWindow; | 128 static DOMWrapperWorld* worldOfInitializingWindow; |
131 | 129 |
132 const int m_worldId; | 130 const int m_worldId; |
133 const int m_extensionGroup; | 131 const int m_extensionGroup; |
134 OwnPtr<DOMDataStore> m_domDataStore; | 132 OwnPtr<DOMDataStore> m_domDataStore; |
135 }; | 133 }; |
136 | 134 |
137 } // namespace WebCore | 135 } // namespace WebCore |
138 | 136 |
139 #endif // DOMWrapperWorld_h | 137 #endif // DOMWrapperWorld_h |
OLD | NEW |