Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / mediasource / MediaSourceBase.cpp
index 9f738bd..a4e0e53 100644 (file)
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "modules/mediasource/MediaSourceBase.h"
 
+#include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
@@ -228,7 +229,6 @@ void MediaSourceBase::endOfStream(const AtomicString& error, ExceptionState& exc
         endOfStreamInternal(blink::WebMediaSource::EndOfStreamStatusDecodeError, exceptionState);
     } else {
         ASSERT_NOT_REACHED(); // IDL enforcement should prevent this case.
-        exceptionState.throwTypeError("parameter 1 is not a valid enum value.");
     }
 }
 
@@ -310,7 +310,14 @@ void MediaSourceBase::stop()
 PassOwnPtr<WebSourceBuffer> MediaSourceBase::createWebSourceBuffer(const String& type, const Vector<String>& codecs, ExceptionState& exceptionState)
 {
     WebSourceBuffer* webSourceBuffer = 0;
-    switch (m_webMediaSource->addSourceBuffer(type, codecs, &webSourceBuffer)) {
+
+    // FIXME: Always use the new frame processor once it has stabilized enough. See http://crbug.com/249422.
+    WebMediaSource::FrameProcessorChoice frameProcessorChoice = RuntimeEnabledFeatures::mediaSourceExperimentalEnabled() ?
+        WebMediaSource::UseNewFrameProcessor : WebMediaSource::UseLegacyFrameProcessor;
+
+    WTF_LOG(Media, "MediaSourceBase::createWebSourceBuffer() %p : frameProcessorChoice = %i", this, frameProcessorChoice);
+
+    switch (m_webMediaSource->addSourceBuffer(type, codecs, frameProcessorChoice, &webSourceBuffer)) {
     case WebMediaSource::AddStatusOk:
         return adoptPtr(webSourceBuffer);
     case WebMediaSource::AddStatusNotSupported:
@@ -338,7 +345,7 @@ void MediaSourceBase::scheduleEvent(const AtomicString& eventName)
 {
     ASSERT(m_asyncEventQueue);
 
-    RefPtr<Event> event = Event::create(eventName);
+    RefPtrWillBeRawPtr<Event> event = Event::create(eventName);
     event->setTarget(this);
 
     m_asyncEventQueue->enqueueEvent(event.release());