Commit 22317f42 authored by James Robinson's avatar James Robinson

Update mojo's WebMimeRegistry for supportsImagePrefixed

This is a new pure virtual on WebMimeRegistry.

The implementations of WebMimeRegistry appear to bind only to net, so
they could go somewhere and be shared by both content/ and mojo/ instead
of duplicated. But this fixes a pending compile error so should probably
happen first.

R=darin@chromium.org

Review URL: https://codereview.chromium.org/511583002

Cr-Commit-Position: refs/heads/master@{#291981}
parent 9e560b59
...@@ -35,6 +35,17 @@ blink::WebMimeRegistry::SupportsType WebMimeRegistryImpl::supportsImageMIMEType( ...@@ -35,6 +35,17 @@ blink::WebMimeRegistry::SupportsType WebMimeRegistryImpl::supportsImageMIMEType(
blink::WebMimeRegistry::IsNotSupported; blink::WebMimeRegistry::IsNotSupported;
} }
blink::WebMimeRegistry::SupportsType
WebMimeRegistryImpl::supportsImagePrefixedMIMEType(
const blink::WebString& mime_type) {
std::string ascii_mime_type = ToASCIIOrEmpty(mime_type);
return (net::IsSupportedImageMimeType(ascii_mime_type) ||
(StartsWithASCII(ascii_mime_type, "image/", true) &&
net::IsSupportedNonImageMimeType(ascii_mime_type)))
? WebMimeRegistry::IsSupported
: WebMimeRegistry::IsNotSupported;
}
blink::WebMimeRegistry::SupportsType blink::WebMimeRegistry::SupportsType
WebMimeRegistryImpl::supportsJavaScriptMIMEType( WebMimeRegistryImpl::supportsJavaScriptMIMEType(
const blink::WebString& mime_type) { const blink::WebString& mime_type) {
......
...@@ -20,6 +20,8 @@ class WebMimeRegistryImpl : public blink::WebMimeRegistry { ...@@ -20,6 +20,8 @@ class WebMimeRegistryImpl : public blink::WebMimeRegistry {
const blink::WebString& mime_type); const blink::WebString& mime_type);
virtual blink::WebMimeRegistry::SupportsType supportsImageMIMEType( virtual blink::WebMimeRegistry::SupportsType supportsImageMIMEType(
const blink::WebString& mime_type); const blink::WebString& mime_type);
virtual blink::WebMimeRegistry::SupportsType supportsImagePrefixedMIMEType(
const blink::WebString& mime_type);
virtual blink::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType( virtual blink::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType(
const blink::WebString& mime_type); const blink::WebString& mime_type);
virtual blink::WebMimeRegistry::SupportsType supportsMediaMIMEType( virtual blink::WebMimeRegistry::SupportsType supportsMediaMIMEType(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment