Index: third_party/WebKit/Source/modules/mediasource/SourceBufferAudioTrack.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGDiscardElement.h b/third_party/WebKit/Source/modules/mediasource/SourceBufferAudioTrack.cpp |
similarity index 59% |
copy from third_party/WebKit/Source/core/svg/SVGDiscardElement.h |
copy to third_party/WebKit/Source/modules/mediasource/SourceBufferAudioTrack.cpp |
index 76b61d8cc55381b4fcaddc4303bdc5e3aee7c0be..30ac4f9803a5aed7d999df2c387221556e5203ab 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGDiscardElement.h |
+++ b/third_party/WebKit/Source/modules/mediasource/SourceBufferAudioTrack.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
+ * Copyright (C) 2016 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -28,33 +28,49 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef SVGDiscardElement_h |
-#define SVGDiscardElement_h |
+#include "modules/mediasource/SourceBufferAudioTrack.h" |
-#include "core/svg/animation/SVGSMILElement.h" |
+#include "core/html/track/AudioTrack.h" |
+#include "modules/mediasource/SourceBuffer.h" |
namespace blink { |
-class SVGDiscardElement final : public SVGSMILElement { |
- DEFINE_WRAPPERTYPEINFO(); |
-public: |
- DECLARE_NODE_FACTORY(SVGDiscardElement); |
+SourceBufferAudioTrack::SourceBufferAudioTrack(SourceBuffer* sourceBuffer) |
+ : m_sourceBuffer(sourceBuffer) |
+{ |
+} |
- bool isSVGDiscardElement() const override { return true; } |
-private: |
- explicit SVGDiscardElement(Document&); |
+SourceBufferAudioTrack::~SourceBufferAudioTrack() |
+{ |
+} |
- void resetAnimatedType() override { } |
- void clearAnimatedType() override { } |
- void applyResultsToTarget() override { } |
- bool hasValidAttributeType() override; |
- bool hasValidAttributeName() override; |
- void animationAttributeChanged() override { } |
+const char* SourceBufferAudioTrack::supplementName() |
+{ |
+ return "SourceBufferAudioTrack"; |
+} |
- void startedActiveInterval() override { } |
- void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) override { } |
-}; |
+SourceBufferAudioTrack& SourceBufferAudioTrack::from(AudioTrack& track) |
+{ |
+ SourceBufferAudioTrack* supplement = static_cast<SourceBufferAudioTrack*>(HeapSupplement<AudioTrack>::from(track, supplementName())); |
+ if (!supplement) { |
+ supplement = new SourceBufferAudioTrack(nullptr); |
+ provideTo(track, supplementName(), supplement); |
+ } |
+ return *supplement; |
+} |
+ |
+// static |
+SourceBuffer* SourceBufferAudioTrack::sourceBuffer(AudioTrack& track) |
+{ |
+ return SourceBufferAudioTrack::from(track).m_sourceBuffer; |
+} |
+ |
+ |
+DEFINE_TRACE(SourceBufferAudioTrack) |
+{ |
+ visitor->trace(m_sourceBuffer); |
+ HeapSupplement<AudioTrack>::trace(visitor); |
+} |
} // namespace blink |
-#endif // SVGDiscardElement_h |