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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 worlds.append(mainWorld()); | 89 worlds.append(mainWorld()); |
90 WorldMap& isolatedWorlds = isolatedWorldMap(); | 90 WorldMap& isolatedWorlds = isolatedWorldMap(); |
91 for (WorldMap::iterator it = isolatedWorlds.begin(); it != isolatedWorlds.en
d(); ++it) | 91 for (WorldMap::iterator it = isolatedWorlds.begin(); it != isolatedWorlds.en
d(); ++it) |
92 worlds.append(it->value); | 92 worlds.append(it->value); |
93 } | 93 } |
94 | 94 |
95 DOMWrapperWorld::~DOMWrapperWorld() | 95 DOMWrapperWorld::~DOMWrapperWorld() |
96 { | 96 { |
97 ASSERT(!isMainWorld()); | 97 ASSERT(!isMainWorld()); |
98 | 98 |
| 99 dispose(); |
| 100 |
99 if (!isIsolatedWorld()) | 101 if (!isIsolatedWorld()) |
100 return; | 102 return; |
101 | 103 |
102 WorldMap& map = isolatedWorldMap(); | 104 WorldMap& map = isolatedWorldMap(); |
103 WorldMap::iterator i = map.find(m_worldId); | 105 WorldMap::iterator i = map.find(m_worldId); |
104 if (i == map.end()) { | 106 if (i == map.end()) { |
105 ASSERT_NOT_REACHED(); | 107 ASSERT_NOT_REACHED(); |
106 return; | 108 return; |
107 } | 109 } |
108 ASSERT(i->value == this); | 110 ASSERT(i->value == this); |
109 | 111 |
110 map.remove(i); | 112 map.remove(i); |
111 isolatedWorldCount--; | 113 isolatedWorldCount--; |
112 ASSERT(map.size() == isolatedWorldCount); | 114 ASSERT(map.size() == isolatedWorldCount); |
113 } | 115 } |
114 | 116 |
| 117 void DOMWrapperWorld::dispose() |
| 118 { |
| 119 m_domDataStore.clear(); |
| 120 } |
| 121 |
115 #ifndef NDEBUG | 122 #ifndef NDEBUG |
116 static bool isIsolatedWorldId(int worldId) | 123 static bool isIsolatedWorldId(int worldId) |
117 { | 124 { |
118 return MainWorldId < worldId && worldId < IsolatedWorldIdLimit; | 125 return MainWorldId < worldId && worldId < IsolatedWorldIdLimit; |
119 } | 126 } |
120 #endif | 127 #endif |
121 | 128 |
122 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, in
t extensionGroup) | 129 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, in
t extensionGroup) |
123 { | 130 { |
124 ASSERT(isIsolatedWorldId(worldId)); | 131 ASSERT(isIsolatedWorldId(worldId)); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 ASSERT(isIsolatedWorldId(worldId)); | 208 ASSERT(isIsolatedWorldId(worldId)); |
202 isolatedWorldContentSecurityPolicies().remove(worldId); | 209 isolatedWorldContentSecurityPolicies().remove(worldId); |
203 } | 210 } |
204 | 211 |
205 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context
) | 212 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context
) |
206 { | 213 { |
207 return V8WindowShell::contextHasCorrectPrototype(context); | 214 return V8WindowShell::contextHasCorrectPrototype(context); |
208 } | 215 } |
209 | 216 |
210 } // namespace WebCore | 217 } // namespace WebCore |
OLD | NEW |