| 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/webaudio/WindowAudioWorklet.h" | 5 #include "modules/webaudio/WindowAudioWorklet.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/LocalDOMWindow.h" | 8 #include "core/frame/LocalDOMWindow.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "modules/webaudio/AudioWorklet.h" | 10 #include "modules/webaudio/AudioWorklet.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Break the following cycle when the context gets detached. | 45 // Break the following cycle when the context gets detached. |
| 46 // Otherwise, the worklet object will leak. | 46 // Otherwise, the worklet object will leak. |
| 47 // | 47 // |
| 48 // window => window.audioWorklet | 48 // window => window.audioWorklet |
| 49 // => WindowAudioWorklet | 49 // => WindowAudioWorklet |
| 50 // => AudioWorklet <--- break this reference | 50 // => AudioWorklet <--- break this reference |
| 51 // => ThreadedWorkletMessagingProxy | 51 // => ThreadedWorkletMessagingProxy |
| 52 // => Document | 52 // => Document |
| 53 // => ... => window | 53 // => ... => window |
| 54 void WindowAudioWorklet::contextDestroyed() { | 54 void WindowAudioWorklet::contextDestroyed(ExecutionContext*) { |
| 55 m_audioWorklet = nullptr; | 55 m_audioWorklet = nullptr; |
| 56 } | 56 } |
| 57 | 57 |
| 58 DEFINE_TRACE(WindowAudioWorklet) { | 58 DEFINE_TRACE(WindowAudioWorklet) { |
| 59 visitor->trace(m_audioWorklet); | 59 visitor->trace(m_audioWorklet); |
| 60 Supplement<LocalDOMWindow>::trace(visitor); | 60 Supplement<LocalDOMWindow>::trace(visitor); |
| 61 ContextLifecycleObserver::trace(visitor); | 61 ContextLifecycleObserver::trace(visitor); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |