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

Unified Diff: third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp

Issue 1534553003: MediaRecorder: correct MIME type parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tommi@s comments Created 5 years 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: third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
index 792a4d1012f26befc690046e62ef4dc29f53dda1..c8c95f61701f3a15969298de06376acc9bd521e3 100644
--- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
+++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
@@ -14,6 +14,7 @@
#include "modules/EventTargetModules.h"
#include "modules/mediarecorder/BlobEvent.h"
#include "modules/mediarecorder/MediaRecorderErrorEvent.h"
+#include "platform/ContentType.h"
#include "platform/NotImplemented.h"
#include "platform/blob/BlobData.h"
#include "public/platform/Platform.h"
@@ -80,7 +81,8 @@ MediaRecorder::MediaRecorder(ExecutionContext* context, MediaStream* stream, con
exceptionState.throwDOMException(NotSupportedError, "No MediaRecorder handler can be created.");
return;
}
- if (!m_recorderHandler->initialize(this, stream->descriptor(), m_mimeType)) {
+ ContentType contentType(m_mimeType);
+ if (!m_recorderHandler->initialize(this, stream->descriptor(), contentType.type(), contentType.parameter("codecs"))) {
exceptionState.throwDOMException(NotSupportedError, "Failed to initialize native MediaRecorder, the type provided " + m_mimeType + "is unsupported." );
return;
}
@@ -173,7 +175,8 @@ bool MediaRecorder::isTypeSupported(const String& type)
// specified MIME type. Recording may still fail if sufficient resources are
// not available to support the concrete media encoding.
// [1] https://w3c.github.io/mediacapture-record/MediaRecorder.html#methods
- return handler->canSupportMimeType(type);
+ ContentType contentType(type);
+ return handler->canSupportMimeType(contentType.type(), contentType.parameter("codecs"));
}
const AtomicString& MediaRecorder::interfaceName() const

Powered by Google App Engine
This is Rietveld 408576698