OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 20 matching lines...) Expand all Loading... | |
31 #include "modules/webaudio/AudioContext.h" | 31 #include "modules/webaudio/AudioContext.h" |
32 #include "modules/webaudio/AudioNodeOutput.h" | 32 #include "modules/webaudio/AudioNodeOutput.h" |
33 #include <algorithm> | 33 #include <algorithm> |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 AudioSummingJunction::AudioSummingJunction(AudioContext* context) | 37 AudioSummingJunction::AudioSummingJunction(AudioContext* context) |
38 : m_context(context) | 38 : m_context(context) |
39 , m_renderingStateNeedUpdating(false) | 39 , m_renderingStateNeedUpdating(false) |
40 { | 40 { |
41 ASSERT(context); | |
42 #if ENABLE(OILPAN) | |
43 m_context->registerLiveAudioSummingJunction(*this); | |
haraken
2014/07/18 10:01:01
Instead of registering an AudioSummingJunction whe
tkent
2014/07/18 13:43:09
We can't do it. markSummingJunctionDirty can be c
haraken
2014/07/18 13:49:01
Makes sense. Probably we can add a comment and men
| |
44 #endif | |
41 } | 45 } |
42 | 46 |
43 AudioSummingJunction::~AudioSummingJunction() | 47 AudioSummingJunction::~AudioSummingJunction() |
44 { | 48 { |
45 // Oilpan: m_context is null if AudioContext and this object die | 49 #if !ENABLE(OILPAN) |
46 // together. It's non-null if this object dies before AudioContext. | |
47 if (m_renderingStateNeedUpdating && m_context.get()) | 50 if (m_renderingStateNeedUpdating && m_context.get()) |
48 m_context->removeMarkedSummingJunction(this); | 51 m_context->removeMarkedSummingJunction(this); |
52 #endif | |
49 } | 53 } |
50 | 54 |
51 void AudioSummingJunction::trace(Visitor* visitor) | 55 void AudioSummingJunction::trace(Visitor* visitor) |
52 { | 56 { |
53 visitor->trace(m_context); | 57 visitor->trace(m_context); |
54 } | 58 } |
55 | 59 |
56 void AudioSummingJunction::changedOutputs() | 60 void AudioSummingJunction::changedOutputs() |
57 { | 61 { |
58 ASSERT(context()->isGraphOwner()); | 62 ASSERT(context()->isGraphOwner()); |
(...skipping 19 matching lines...) Expand all Loading... | |
78 | 82 |
79 didUpdate(); | 83 didUpdate(); |
80 | 84 |
81 m_renderingStateNeedUpdating = false; | 85 m_renderingStateNeedUpdating = false; |
82 } | 86 } |
83 } | 87 } |
84 | 88 |
85 } // namespace WebCore | 89 } // namespace WebCore |
86 | 90 |
87 #endif // ENABLE(WEB_AUDIO) | 91 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |