summaryrefslogtreecommitdiffstats
path: root/webkit/glue/simple_webmimeregistry_impl.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 00:51:24 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 00:51:24 +0000
commit58328246906fef11536e5797e4d2ff6af9861122 (patch)
tree1727fbc86bc82ba04da5af1f754a0ffc4d848d8a /webkit/glue/simple_webmimeregistry_impl.cc
parent8bf2fe3abd6996ee1c03fbb02775b7a5f7328e7c (diff)
downloadchromium_src-58328246906fef11536e5797e4d2ff6af9861122.zip
chromium_src-58328246906fef11536e5797e4d2ff6af9861122.tar.gz
chromium_src-58328246906fef11536e5797e4d2ff6af9861122.tar.bz2
Revert "Fix a DCHECK we hit when a mime type isn't ASCII."
This reverts commit r22027. Red builders. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/simple_webmimeregistry_impl.cc')
-rw-r--r--webkit/glue/simple_webmimeregistry_impl.cc24
1 files changed, 6 insertions, 18 deletions
diff --git a/webkit/glue/simple_webmimeregistry_impl.cc b/webkit/glue/simple_webmimeregistry_impl.cc
index 63c1165..29296ff 100644
--- a/webkit/glue/simple_webmimeregistry_impl.cc
+++ b/webkit/glue/simple_webmimeregistry_impl.cc
@@ -14,30 +14,18 @@
using WebKit::WebString;
using WebKit::WebMimeRegistry;
-namespace {
-
-// Convert a WebString to ASCII, falling back on an empty string in the case
-// of a non-ASCII string.
-const std::string& AsASCII(const WebString& string) {
- if (!IsStringASCII(string))
- return EmptyString();
- return UTF16ToASCII(string);
-}
-
-} // namespace
-
namespace webkit_glue {
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsImageMIMEType(
const WebString& mime_type) {
- if (!net::IsSupportedImageMimeType(AsASCII(mime_type).c_str()))
+ if (!net::IsSupportedImageMimeType(UTF16ToASCII(mime_type).c_str()))
return WebMimeRegistry::IsNotSupported;
return WebMimeRegistry::IsSupported;
}
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsJavaScriptMIMEType(
const WebString& mime_type) {
- if (!net::IsSupportedJavascriptMimeType(AsASCII(mime_type).c_str()))
+ if (!net::IsSupportedJavascriptMimeType(UTF16ToASCII(mime_type).c_str()))
return WebMimeRegistry::IsNotSupported;
return WebMimeRegistry::IsSupported;
}
@@ -45,12 +33,12 @@ WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsJavaScriptMIMET
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType(
const WebString& mime_type, const WebString& codecs) {
// Not supporting the container is a flat-out no.
- if (!net::IsSupportedMediaMimeType(AsASCII(mime_type).c_str()))
+ if (!net::IsSupportedMediaMimeType(UTF16ToASCII(mime_type).c_str()))
return IsNotSupported;
// If we don't recognize the codec, it's possible we support it.
std::vector<std::string> parsed_codecs;
- net::ParseCodecString(AsASCII(codecs).c_str(), &parsed_codecs);
+ net::ParseCodecString(UTF16ToASCII(codecs).c_str(), &parsed_codecs);
if (!net::AreSupportedMediaCodecs(parsed_codecs))
return MayBeSupported;
@@ -60,7 +48,7 @@ WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType(
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsNonImageMIMEType(
const WebString& mime_type) {
- if (!net::IsSupportedNonImageMimeType(AsASCII(mime_type).c_str()))
+ if (!net::IsSupportedNonImageMimeType(UTF16ToASCII(mime_type).c_str()))
return WebMimeRegistry::IsNotSupported;
return WebMimeRegistry::IsSupported;
}
@@ -84,7 +72,7 @@ WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile(
WebString SimpleWebMimeRegistryImpl::preferredExtensionForMIMEType(
const WebString& mime_type) {
FilePath::StringType file_extension;
- net::GetPreferredExtensionForMimeType(AsASCII(mime_type),
+ net::GetPreferredExtensionForMimeType(UTF16ToASCII(mime_type),
&file_extension);
return FilePathStringToWebString(file_extension);
}