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

Unified Diff: Source/core/html/track/TrackBase.cpp

Issue 284513003: Implement AudioTrack, AudioTrackList, VideoTrack, and VideoTrackList (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nits Created 6 years, 6 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
« no previous file with comments | « Source/core/html/track/TrackBase.h ('k') | Source/core/html/track/TrackListBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/TrackBase.cpp
diff --git a/Source/core/html/track/TrackBase.cpp b/Source/core/html/track/TrackBase.cpp
index a11c065f41080f3d1d9d5b8d9e5b8b5c4a43105d..a63849b253ff72927a57d93163aea5ccde790f79 100644
--- a/Source/core/html/track/TrackBase.cpp
+++ b/Source/core/html/track/TrackBase.cpp
@@ -31,18 +31,42 @@
#include "config.h"
#include "core/html/track/TrackBase.h"
+#include "core/html/HTMLMediaElement.h"
+
namespace WebCore {
-TrackBase::TrackBase(Type type, const AtomicString& label, const AtomicString& language, const AtomicString& id)
- : m_type(type)
+static blink::WebMediaPlayer::TrackId nextTrackId()
+{
+ static blink::WebMediaPlayer::TrackId next = 0;
+ return ++next;
+}
+
+TrackBase::TrackBase(Type type, const AtomicString& label, const AtomicString& language, const String& id)
+ : m_trackId(nextTrackId())
+ , m_type(type)
, m_label(label)
, m_language(language)
, m_id(id)
+ , m_mediaElement(nullptr)
{
}
TrackBase::~TrackBase()
{
+#if !ENABLE(OILPAN)
+ ASSERT(!m_mediaElement);
+#endif
+}
+
+
+Node* TrackBase::owner() const
+{
+ return m_mediaElement;
+}
+
+void TrackBase::trace(Visitor* visitor)
+{
+ visitor->trace(m_mediaElement);
}
void TrackBase::setKind(const AtomicString& kind)
@@ -54,4 +78,3 @@ void TrackBase::setKind(const AtomicString& kind)
}
} // namespace WebCore
-
« no previous file with comments | « Source/core/html/track/TrackBase.h ('k') | Source/core/html/track/TrackListBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698