| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 ASSERT(i->value == this); | 108 ASSERT(i->value == this); |
| 109 | 109 |
| 110 map.remove(i); | 110 map.remove(i); |
| 111 isolatedWorldCount--; | 111 isolatedWorldCount--; |
| 112 ASSERT(map.size() == isolatedWorldCount); | 112 ASSERT(map.size() == isolatedWorldCount); |
| 113 } | 113 } |
| 114 | 114 |
| 115 #ifndef NDEBUG | 115 #ifndef NDEBUG |
| 116 static bool isIsolatedWorldId(int worldId) | 116 static bool isIsolatedWorldId(int worldId) |
| 117 { | 117 { |
| 118 return worldId != MainWorldId && worldId != WorkerWorldId; | 118 return MainWorldId < worldId && worldId < IsolatedWorldIdLimit; |
| 119 } | 119 } |
| 120 #endif | 120 #endif |
| 121 | 121 |
| 122 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, in
t extensionGroup) | 122 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, in
t extensionGroup) |
| 123 { | 123 { |
| 124 ASSERT(isIsolatedWorldId(worldId)); | 124 ASSERT(isIsolatedWorldId(worldId)); |
| 125 | 125 |
| 126 WorldMap& map = isolatedWorldMap(); | 126 WorldMap& map = isolatedWorldMap(); |
| 127 WorldMap::AddResult result = map.add(worldId, 0); | 127 WorldMap::AddResult result = map.add(worldId, 0); |
| 128 RefPtr<DOMWrapperWorld> world = result.storedValue->value; | 128 RefPtr<DOMWrapperWorld> world = result.storedValue->value; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 ASSERT(isIsolatedWorldId(worldId)); | 201 ASSERT(isIsolatedWorldId(worldId)); |
| 202 isolatedWorldContentSecurityPolicies().remove(worldId); | 202 isolatedWorldContentSecurityPolicies().remove(worldId); |
| 203 } | 203 } |
| 204 | 204 |
| 205 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context
) | 205 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context
) |
| 206 { | 206 { |
| 207 return V8WindowShell::contextHasCorrectPrototype(context); | 207 return V8WindowShell::contextHasCorrectPrototype(context); |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace WebCore | 210 } // namespace WebCore |
| OLD | NEW |