diff options
-rw-r--r-- | webkit/glue/chromium_bridge_impl.cc | 12 | ||||
-rw-r--r-- | webkit/port/platform/MIMETypeRegistry.cpp | 10 | ||||
-rw-r--r-- | webkit/port/platform/chromium/ChromiumBridge.h | 3 |
3 files changed, 20 insertions, 5 deletions
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc index 1115d3d..3c53e28 100644 --- a/webkit/glue/chromium_bridge_impl.cc +++ b/webkit/glue/chromium_bridge_impl.cc @@ -247,6 +247,18 @@ bool ChromiumBridge::layoutTestMode() { // MimeType ------------------------------------------------------------------- +bool isSupportedImageMIMEType(const char* mime_type) { + return net::IsSupportedImageMimeType(mime_type); +} + +bool isSupportedJavascriptMIMEType(const char* mime_type) { + return net::IsSupportedJavascriptMimeType(mime_type); +} + +bool isSupportedNonImageMIMEType(const char* mime_type) { + return net::IsSupportedNonImageMimeType(mime_type); +} + bool ChromiumBridge::matchesMIMEType(const String& pattern, const String& type) { return net::MatchesMimeType(webkit_glue::StringToStdString(pattern), diff --git a/webkit/port/platform/MIMETypeRegistry.cpp b/webkit/port/platform/MIMETypeRegistry.cpp index 7e7d898..670b5c3 100644 --- a/webkit/port/platform/MIMETypeRegistry.cpp +++ b/webkit/port/platform/MIMETypeRegistry.cpp @@ -24,6 +24,7 @@ */ #include "config.h" +#include "ChromiumBridge.h" #include "CString.h" #include "MIMETypeRegistry.h" #include "MediaPlayer.h" @@ -31,8 +32,6 @@ #include <wtf/HashMap.h> #include <wtf/HashSet.h> -#include "net/base/mime_util.h" - namespace WebCore { @@ -74,7 +73,7 @@ String MIMETypeRegistry::getMIMETypeForPath(const String& path) bool MIMETypeRegistry::isSupportedImageMIMEType(const String& mimeType) { return !mimeType.isEmpty() - && net::IsSupportedImageMimeType(mimeType.latin1().data()); + && ChromiumBridge::isSupportedImageMIMEType(mimeType.latin1().data()); } bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeType) @@ -85,8 +84,9 @@ bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeTyp bool MIMETypeRegistry::isSupportedJavaScriptMIMEType(const String& mimeType) { + const char* data = mimeType.latin1().data(); return !mimeType.isEmpty() - && net::IsSupportedJavascriptMimeType(mimeType.latin1().data()); + && ChromiumBridge::isSupportedJavascriptMIMEType(data); } bool MIMETypeRegistry::isSupportedImageResourceMIMEType(const String& mimeType) @@ -97,7 +97,7 @@ bool MIMETypeRegistry::isSupportedImageResourceMIMEType(const String& mimeType) bool MIMETypeRegistry::isSupportedNonImageMIMEType(const String& mimeType) { return !mimeType.isEmpty() - && net::IsSupportedNonImageMimeType(mimeType.latin1().data()); + && ChromiumBridge::isSupportedNonImageMIMEType(mimeType.latin1().data()); } #if ENABLE(VIDEO) diff --git a/webkit/port/platform/chromium/ChromiumBridge.h b/webkit/port/platform/chromium/ChromiumBridge.h index 4e4e5b1..7c4e1c1 100644 --- a/webkit/port/platform/chromium/ChromiumBridge.h +++ b/webkit/port/platform/chromium/ChromiumBridge.h @@ -96,6 +96,9 @@ namespace WebCore { static bool layoutTestMode(); // MimeType ----------------------------------------------------------- + static bool isSupportedImageMIMEType(const char* mime_type); + static bool isSupportedJavascriptMIMEType(const char* mime_type); + static bool isSupportedNonImageMIMEType(const char* mime_type); static bool matchesMIMEType(const String& pattern, const String& type); static String mimeTypeForExtension(const String& ext); static String mimeTypeFromFile(const String& file_path); |