diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-26 21:16:34 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-26 21:16:34 +0000 |
commit | 649ef5b3ccbdfc08cb2386f3bdb313e81e6f9d84 (patch) | |
tree | 84351b0c493aefa98003279db3cd54b20b196e5c /webkit | |
parent | 5e4127cea18127621a0ccb5ee4dd84f1bd505222 (diff) | |
download | chromium_src-649ef5b3ccbdfc08cb2386f3bdb313e81e6f9d84.zip chromium_src-649ef5b3ccbdfc08cb2386f3bdb313e81e6f9d84.tar.gz chromium_src-649ef5b3ccbdfc08cb2386f3bdb313e81e6f9d84.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@6049 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 | 5 |
3 files changed, 21 insertions, 6 deletions
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc index b8810ca..aa7f994 100644 --- a/webkit/glue/chromium_bridge_impl.cc +++ b/webkit/glue/chromium_bridge_impl.cc @@ -248,6 +248,18 @@ bool ChromiumBridge::layoutTestMode() { // MimeType ------------------------------------------------------------------- +bool ChromiumBridge::isSupportedImageMIMEType(const char* mime_type) { + return net::IsSupportedImageMimeType(mime_type); +} + +bool ChromiumBridge::isSupportedJavascriptMIMEType(const char* mime_type) { + return net::IsSupportedJavascriptMimeType(mime_type); +} + +bool ChromiumBridge::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 1c8b034..3513293 100644 --- a/webkit/port/platform/chromium/ChromiumBridge.h +++ b/webkit/port/platform/chromium/ChromiumBridge.h @@ -39,7 +39,7 @@ class NativeImageSkia; typedef struct NPObject NPObject; -typedef struct _NPP NPP_t;
+typedef struct _NPP NPP_t; typedef NPP_t* NPP; #if PLATFORM(WIN_OS) @@ -98,6 +98,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); |