summaryrefslogtreecommitdiffstats
path: root/webkit/api
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/api')
-rw-r--r--webkit/api/public/WebMimeRegistry.h17
-rw-r--r--webkit/api/src/ChromiumBridge.cpp9
-rw-r--r--webkit/api/src/WebMediaPlayerClientImpl.cpp15
3 files changed, 27 insertions, 14 deletions
diff --git a/webkit/api/public/WebMimeRegistry.h b/webkit/api/public/WebMimeRegistry.h
index 100331f..8707f3f 100644
--- a/webkit/api/public/WebMimeRegistry.h
+++ b/webkit/api/public/WebMimeRegistry.h
@@ -1,10 +1,10 @@
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -38,10 +38,13 @@ namespace WebKit {
class WebMimeRegistry {
public:
- virtual bool supportsImageMIMEType(const WebString& mimeType) = 0;
- virtual bool supportsJavaScriptMIMEType(const WebString& mimeType) = 0;
- virtual bool supportsMediaMIMEType(const WebString& mimeType) = 0;
- virtual bool supportsNonImageMIMEType(const WebString& mimeType) = 0;
+ enum SupportsType { IsNotSupported, IsSupported, MayBeSupported };
+
+ virtual SupportsType supportsImageMIMEType(const WebString& mimeType) = 0;
+ virtual SupportsType supportsJavaScriptMIMEType(const WebString& mimeType) = 0;
+ virtual SupportsType supportsMediaMIMEType(const WebString& mimeType,
+ const WebString& codecs) = 0;
+ virtual SupportsType supportsNonImageMIMEType(const WebString& mimeType) = 0;
virtual WebString mimeTypeForExtension(const WebString& fileExtension) = 0;
virtual WebString mimeTypeFromFile(const WebString& filePath) = 0;
diff --git a/webkit/api/src/ChromiumBridge.cpp b/webkit/api/src/ChromiumBridge.cpp
index f8d2e99..93ac857 100644
--- a/webkit/api/src/ChromiumBridge.cpp
+++ b/webkit/api/src/ChromiumBridge.cpp
@@ -196,17 +196,20 @@ bool ChromiumBridge::layoutTestMode()
bool ChromiumBridge::isSupportedImageMIMEType(const String& mimeType)
{
- return webKitClient()->mimeRegistry()->supportsImageMIMEType(mimeType);
+ return webKitClient()->mimeRegistry()->supportsImageMIMEType(mimeType)
+ != WebMimeRegistry::IsNotSupported;
}
bool ChromiumBridge::isSupportedJavaScriptMIMEType(const String& mimeType)
{
- return webKitClient()->mimeRegistry()->supportsJavaScriptMIMEType(mimeType);
+ return webKitClient()->mimeRegistry()->supportsJavaScriptMIMEType(mimeType)
+ != WebMimeRegistry::IsNotSupported;
}
bool ChromiumBridge::isSupportedNonImageMIMEType(const String& mimeType)
{
- return webKitClient()->mimeRegistry()->supportsNonImageMIMEType(mimeType);
+ return webKitClient()->mimeRegistry()->supportsNonImageMIMEType(mimeType)
+ != WebMimeRegistry::IsNotSupported;
}
String ChromiumBridge::mimeTypeForExtension(const String& extension)
diff --git a/webkit/api/src/WebMediaPlayerClientImpl.cpp b/webkit/api/src/WebMediaPlayerClientImpl.cpp
index 0451ad8..d26bd16 100644
--- a/webkit/api/src/WebMediaPlayerClientImpl.cpp
+++ b/webkit/api/src/WebMediaPlayerClientImpl.cpp
@@ -377,10 +377,17 @@ void WebMediaPlayerClientImpl::getSupportedTypes(HashSet<String>& supportedTypes
MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& type,
const String& codecs)
{
- // FIXME: respect codecs, now we only check for mime-type.
- if (webKitClient()->mimeRegistry()->supportsMediaMIMEType(type))
- return MediaPlayer::IsSupported;
- return MediaPlayer::IsNotSupported;
+ WebMimeRegistry::SupportsType supportsType =
+ webKitClient()->mimeRegistry()->supportsMediaMIMEType(type, codecs);
+
+ switch (supportsType) {
+ case WebMimeRegistry::IsNotSupported:
+ return MediaPlayer::IsNotSupported;
+ case WebMimeRegistry::IsSupported:
+ return MediaPlayer::IsSupported;
+ case WebMimeRegistry::MayBeSupported:
+ return MediaPlayer::MayBeSupported;
+ }
}
WebMediaPlayerClientImpl::WebMediaPlayerClientImpl()