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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "bindings/core/v8/DOMWrapperWorld.h" | 31 #include "bindings/core/v8/DOMWrapperWorld.h" |
32 | 32 |
33 #include <memory> | 33 #include <memory> |
| 34 |
34 #include "bindings/core/v8/DOMDataStore.h" | 35 #include "bindings/core/v8/DOMDataStore.h" |
35 #include "bindings/core/v8/ScriptController.h" | 36 #include "bindings/core/v8/ScriptFunction.h" |
36 #include "bindings/core/v8/V8Binding.h" | |
37 #include "bindings/core/v8/V8DOMActivityLogger.h" | |
38 #include "bindings/core/v8/V8DOMWrapper.h" | |
39 #include "bindings/core/v8/V8Window.h" | |
40 #include "bindings/core/v8/WindowProxy.h" | |
41 #include "bindings/core/v8/WrapperTypeInfo.h" | |
42 #include "core/dom/ExecutionContext.h" | |
43 #include "platform/wtf/HashTraits.h" | 37 #include "platform/wtf/HashTraits.h" |
44 #include "platform/wtf/PtrUtil.h" | 38 #include "platform/wtf/PtrUtil.h" |
45 #include "platform/wtf/StdLibExtras.h" | 39 #include "platform/wtf/StdLibExtras.h" |
46 | 40 |
47 namespace blink { | 41 namespace blink { |
48 | 42 |
49 class DOMObjectHolderBase { | 43 class DOMObjectHolderBase { |
50 USING_FAST_MALLOC(DOMObjectHolderBase); | 44 USING_FAST_MALLOC(DOMObjectHolderBase); |
51 | 45 |
52 public: | 46 public: |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 case WorldType::kWorker: | 324 case WorldType::kWorker: |
331 int world_id = *next_world_id; | 325 int world_id = *next_world_id; |
332 CHECK_GE(world_id, WorldId::kUnspecifiedWorldIdStart); | 326 CHECK_GE(world_id, WorldId::kUnspecifiedWorldIdStart); |
333 *next_world_id = world_id + 1; | 327 *next_world_id = world_id + 1; |
334 return world_id; | 328 return world_id; |
335 } | 329 } |
336 NOTREACHED(); | 330 NOTREACHED(); |
337 return kInvalidWorldId; | 331 return kInvalidWorldId; |
338 } | 332 } |
339 | 333 |
| 334 void DOMWrapperWorld::DissociateDOMWindowWrappersInAllWorlds( |
| 335 ScriptWrappable* script_wrappable) { |
| 336 DCHECK(script_wrappable); |
| 337 DCHECK(IsMainThread()); |
| 338 |
| 339 script_wrappable->UnsetWrapperIfAny(); |
| 340 |
| 341 for (auto& world : GetWorldMap().Values()) |
| 342 world->DomDataStore().UnsetWrapperIfAny(script_wrappable); |
| 343 } |
| 344 |
340 } // namespace blink | 345 } // namespace blink |
OLD | NEW |