Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 604753003: Removing #ifdefs for WEB_AUDIO compile time flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 70b17b45a3cd8bb61e5e51cae5f61c58b2e6c2eb..9c1ac3fd5aadb45a4e0835ce2046a539b56c4fb0 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -81,10 +81,8 @@
#include "wtf/text/CString.h"
#include <limits>
-#if ENABLE(WEB_AUDIO)
#include "platform/audio/AudioSourceProvider.h"
#include "platform/audio/AudioSourceProviderClient.h"
-#endif
using blink::WebInbandTextTrack;
using blink::WebMediaPlayer;
@@ -172,7 +170,6 @@ private:
class AudioSourceProviderClientLockScope {
STACK_ALLOCATED();
public:
-#if ENABLE(WEB_AUDIO)
AudioSourceProviderClientLockScope(HTMLMediaElement& element)
: m_client(element.audioSourceNode())
{
@@ -187,10 +184,6 @@ public:
private:
Member<AudioSourceProviderClient> m_client;
-#else
- explicit AudioSourceProviderClientLockScope(HTMLMediaElement&) { }
- ~AudioSourceProviderClientLockScope() { }
-#endif
};
static const AtomicString& AudioKindToString(WebMediaPlayerClient::AudioTrackKind kind)
@@ -362,9 +355,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_videoTracks(VideoTrackList::create(*this))
, m_textTracks(nullptr)
, m_ignoreTrackDisplayUpdate(0)
-#if ENABLE(WEB_AUDIO)
, m_audioSourceNode(nullptr)
-#endif
{
ASSERT(RuntimeEnabledFeatures::mediaEnabled());
@@ -461,9 +452,7 @@ HTMLMediaElement::~HTMLMediaElement()
// Since AudioNode::dispose() is guaranteed to be always called before
// the AudioNode is destructed, m_audioSourceNode is explicitly cleared
// even if the AudioNode and the HTMLMediaElement die together.
-#if ENABLE(WEB_AUDIO)
ASSERT(!m_audioSourceNode);
-#endif
clearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
#if !ENABLE(OILPAN)
@@ -3453,10 +3442,8 @@ void HTMLMediaElement::userCancelledLoad()
void HTMLMediaElement::clearMediaPlayerAndAudioSourceProviderClientWithoutLocking()
{
-#if ENABLE(WEB_AUDIO)
if (audioSourceProvider())
audioSourceProvider()->setClient(0);
-#endif
m_player.clear();
}
@@ -3807,15 +3794,12 @@ void HTMLMediaElement::createMediaPlayer()
m_remoteRoutesAvailable = false;
m_playingRemotely = false;
-#if ENABLE(WEB_AUDIO)
if (m_audioSourceNode && audioSourceProvider()) {
// When creating the player, make sure its AudioSourceProvider knows about the client.
audioSourceProvider()->setClient(m_audioSourceNode);
}
-#endif
}
-#if ENABLE(WEB_AUDIO)
void HTMLMediaElement::setAudioSourceNode(AudioSourceProviderClient* sourceNode)
{
m_audioSourceNode = sourceNode;
@@ -3832,7 +3816,6 @@ AudioSourceProvider* HTMLMediaElement::audioSourceProvider()
return 0;
}
-#endif
const AtomicString& HTMLMediaElement::mediaGroup() const
{
@@ -3993,9 +3976,7 @@ void HTMLMediaElement::trace(Visitor* visitor)
visitor->trace(m_textTracks);
visitor->trace(m_textTracksWhenResourceSelectionBegan);
visitor->trace(m_mediaController);
-#if ENABLE(WEB_AUDIO)
visitor->registerWeakMembers<HTMLMediaElement, &HTMLMediaElement::clearWeakMembers>(this);
-#endif
HeapSupplementable<HTMLMediaElement>::trace(visitor);
#endif
HTMLElement::trace(visitor);
@@ -4029,12 +4010,10 @@ void HTMLMediaElement::selectInitialTracksIfNecessary()
videoTracks().anonymousIndexedGetter(0)->setSelected(true);
}
-#if ENABLE(WEB_AUDIO)
void HTMLMediaElement::clearWeakMembers(Visitor* visitor)
{
if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider())
audioSourceProvider()->setClient(0);
}
-#endif
}

Powered by Google App Engine
This is Rietveld 408576698