From f723328d69ec8522ca52899d1158fca699170f31 Mon Sep 17 00:00:00 2001 From: "darin@chromium.org" Date: Wed, 26 Nov 2008 19:51:29 +0000 Subject: Remove dependencies on base/ from MIMETypeRegistry.cpp Patch by phajdan.jr@gmail.com R=darin Review URL: http://codereview.chromium.org/12004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6043 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/chromium_bridge_impl.cc | 12 ++++++++++++ webkit/port/platform/MIMETypeRegistry.cpp | 10 +++++----- 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 #include -#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); -- cgit v1.1