diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-26 19:51:29 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-26 19:51:29 +0000 |
commit | f723328d69ec8522ca52899d1158fca699170f31 (patch) | |
tree | 2afd9e3d2c23ab4f2de421eafe0efae7f62355dd /webkit | |
parent | 5f6c5e28735c2aa6a72ad81b1ff6b50d92e9ed90 (diff) | |
download | chromium_src-f723328d69ec8522ca52899d1158fca699170f31.zip chromium_src-f723328d69ec8522ca52899d1158fca699170f31.tar.gz chromium_src-f723328d69ec8522ca52899d1158fca699170f31.tar.bz2 |
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
Diffstat (limited to 'webkit')
-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); |