OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/csspaint/PaintWorklet.h" | 5 #include "modules/csspaint/PaintWorklet.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptSourceCode.h" | 7 #include "bindings/core/v8/ScriptSourceCode.h" |
8 #include "bindings/core/v8/V8GCController.h" | 8 #include "bindings/core/v8/V8GCController.h" |
9 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" | 9 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 ScopedPersistent<v8::Function> handle; | 48 ScopedPersistent<v8::Function> handle; |
49 { | 49 { |
50 v8::HandleScope handleScope(isolate); | 50 v8::HandleScope handleScope(isolate); |
51 handle.set(isolate, definition->paintFunctionForTesting(isolate)); | 51 handle.set(isolate, definition->paintFunctionForTesting(isolate)); |
52 handle.setPhantom(); | 52 handle.setPhantom(); |
53 } | 53 } |
54 ASSERT(!handle.isEmpty()); | 54 ASSERT(!handle.isEmpty()); |
55 ASSERT(handle.isWeak()); | 55 ASSERT(handle.isWeak()); |
56 | 56 |
57 // Run a GC, persistent shouldn't have been collected yet. | 57 // Run a GC, persistent shouldn't have been collected yet. |
58 ThreadState::current()-> collectAllGarbage(); | 58 ThreadHeap::collectAllGarbage(); |
59 V8GCController::collectAllGarbageForTesting(isolate); | 59 V8GCController::collectAllGarbageForTesting(isolate); |
60 ASSERT(!handle.isEmpty()); | 60 ASSERT(!handle.isEmpty()); |
61 | 61 |
62 // Delete the page & associated objects. | 62 // Delete the page & associated objects. |
63 m_page.reset(); | 63 m_page.reset(); |
64 | 64 |
65 // Run a GC, the persistent should have been collected. | 65 // Run a GC, the persistent should have been collected. |
66 ThreadState::current()-> collectAllGarbage(); | 66 ThreadHeap::collectAllGarbage(); |
67 V8GCController::collectAllGarbageForTesting(isolate); | 67 V8GCController::collectAllGarbageForTesting(isolate); |
68 ASSERT(handle.isEmpty()); | 68 ASSERT(handle.isEmpty()); |
69 } | 69 } |
70 | 70 |
71 } // naespace blink | 71 } // naespace blink |
OLD | NEW |