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

Unified Diff: content/child/simple_webmimeregistry_impl.cc

Issue 2440163002: Cleanup WebMIMERegistry implementation and fix LinkLoader behavior (Closed)
Patch Set: minor fix Created 4 years, 2 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: content/child/simple_webmimeregistry_impl.cc
diff --git a/content/child/simple_webmimeregistry_impl.cc b/content/child/simple_webmimeregistry_impl.cc
index 994b17ed2bf027d9998b18250e9a3d6aae22c9ad..a2ce6281dac867c62809eff26143c68f0217fd87 100644
--- a/content/child/simple_webmimeregistry_impl.cc
+++ b/content/child/simple_webmimeregistry_impl.cc
@@ -10,6 +10,7 @@
#include "base/strings/utf_string_conversions.h"
#include "components/mime_util/mime_util.h"
#include "media/base/mime_util.h"
+#include "media/filters/stream_parser_factory.h"
#include "net/base/mime_util.h"
#include "third_party/WebKit/public/platform/FilePathConversion.h"
#include "third_party/WebKit/public/platform/WebString.h"
@@ -60,21 +61,26 @@ WebMimeRegistry::SupportsType
: WebMimeRegistry::IsNotSupported;
}
-// When debugging layout tests failures in the test shell,
-// see TestShellWebMimeRegistryImpl.
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType(
const WebString& mime_type,
const WebString& codecs) {
- // Media features are only supported at the content/renderer/ layer.
- return IsNotSupported;
+ const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type);
+ std::vector<std::string> codec_vector;
+ media::ParseCodecString(ToASCIIOrEmpty(codecs), &codec_vector, false);
+ return static_cast<WebMimeRegistry::SupportsType>(
+ media::IsSupportedMediaFormat(mime_type_ascii, codec_vector));
}
bool SimpleWebMimeRegistryImpl::supportsMediaSourceMIMEType(
const WebString& mime_type,
const WebString& codecs) {
- // Media features are only supported at the content/renderer layer.
const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type);
- return media::IsSupportedMediaMimeType(mime_type_ascii);
+ if (mime_type_ascii.empty())
+ return false;
+ std::vector<std::string> parsed_codec_ids;
+ media::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codec_ids, false);
+ return media::StreamParserFactory::IsTypeSupported(mime_type_ascii,
+ parsed_codec_ids);
}
WebMimeRegistry::SupportsType
« no previous file with comments | « no previous file | content/renderer/renderer_blink_platform_impl.cc » ('j') | third_party/WebKit/Source/core/loader/LinkLoader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698