summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 04:43:51 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 04:43:51 +0000
commit1111563020b92fc9f6943e0b5c00f66de2f57082 (patch)
treebe1587a835de84b5164658af971c1b626bf9b2f2 /webkit
parent83a0cbe4af4408d7708bf54750aff66da80f3130 (diff)
downloadchromium_src-1111563020b92fc9f6943e0b5c00f66de2f57082.zip
chromium_src-1111563020b92fc9f6943e0b5c00f66de2f57082.tar.gz
chromium_src-1111563020b92fc9f6943e0b5c00f66de2f57082.tar.bz2
Eliminate mime_util dependency in FrameLoaderClientImpl.
This is a revision of http://codereview.chromium.org/344018 that adds an implementation of WebMimeRegistry for the worker process. We need this to support the dummy WebView created for workers. R=jam BUG=24604 TEST=covered by worker ui tests Review URL: http://codereview.chromium.org/342104 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/api/public/WebMimeRegistry.h1
-rw-r--r--webkit/api/src/FrameLoaderClientImpl.cpp6
-rw-r--r--webkit/glue/simple_webmimeregistry_impl.cc7
-rw-r--r--webkit/glue/simple_webmimeregistry_impl.h2
4 files changed, 12 insertions, 4 deletions
diff --git a/webkit/api/public/WebMimeRegistry.h b/webkit/api/public/WebMimeRegistry.h
index e85b9cd..afdf736 100644
--- a/webkit/api/public/WebMimeRegistry.h
+++ b/webkit/api/public/WebMimeRegistry.h
@@ -40,6 +40,7 @@ namespace WebKit {
public:
enum SupportsType { IsNotSupported, IsSupported, MayBeSupported };
+ virtual SupportsType supportsMIMEType(const WebString& mimeType) = 0;
virtual SupportsType supportsImageMIMEType(const WebString& mimeType) = 0;
virtual SupportsType supportsJavaScriptMIMEType(const WebString& mimeType) = 0;
virtual SupportsType supportsMediaMIMEType(const WebString& mimeType,
diff --git a/webkit/api/src/FrameLoaderClientImpl.cpp b/webkit/api/src/FrameLoaderClientImpl.cpp
index 2af13cb..71553ba 100644
--- a/webkit/api/src/FrameLoaderClientImpl.cpp
+++ b/webkit/api/src/FrameLoaderClientImpl.cpp
@@ -53,6 +53,7 @@
#include "WebFrameImpl.h"
#include "WebKit.h"
#include "WebKitClient.h"
+#include "WebMimeRegistry.h"
#include "WebNode.h"
#include "WebPlugin.h"
#include "WebPluginParams.h"
@@ -70,9 +71,6 @@
#include "WrappedResourceRequest.h"
#include "WrappedResourceResponse.h"
-// FIXME: remove these
-#include "net/base/mime_util.h"
-
using namespace WebCore;
namespace WebKit {
@@ -1122,7 +1120,7 @@ bool FrameLoaderClientImpl::canShowMIMEType(const String& mimeType) const
// mimeType strings are supposed to be ASCII, but if they are not for some
// reason, then it just means that the mime type will fail all of these "is
// supported" checks and go down the path of an unhandled mime type.
- if (net::IsSupportedMimeType(mimeType.latin1().data()))
+ if (webKitClient()->mimeRegistry()->supportsMIMEType(mimeType) == WebMimeRegistry::IsSupported)
return true;
// If Chrome is started with the --disable-plugins switch, pluginData is null.
diff --git a/webkit/glue/simple_webmimeregistry_impl.cc b/webkit/glue/simple_webmimeregistry_impl.cc
index a2b792d..2857002 100644
--- a/webkit/glue/simple_webmimeregistry_impl.cc
+++ b/webkit/glue/simple_webmimeregistry_impl.cc
@@ -28,6 +28,13 @@ std::string AsASCII(const WebString& string) {
namespace webkit_glue {
+WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMIMEType(
+ const WebString& mime_type) {
+ if (!net::IsSupportedMimeType(AsASCII(mime_type).c_str()))
+ return WebMimeRegistry::IsNotSupported;
+ return WebMimeRegistry::IsSupported;
+}
+
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsImageMIMEType(
const WebString& mime_type) {
if (!net::IsSupportedImageMimeType(AsASCII(mime_type).c_str()))
diff --git a/webkit/glue/simple_webmimeregistry_impl.h b/webkit/glue/simple_webmimeregistry_impl.h
index 003a9f4..9587562 100644
--- a/webkit/glue/simple_webmimeregistry_impl.h
+++ b/webkit/glue/simple_webmimeregistry_impl.h
@@ -12,6 +12,8 @@ namespace webkit_glue {
class SimpleWebMimeRegistryImpl : public WebKit::WebMimeRegistry {
public:
// WebMimeRegistry methods:
+ virtual WebKit::WebMimeRegistry::SupportsType supportsMIMEType(
+ const WebKit::WebString&);
virtual WebKit::WebMimeRegistry::SupportsType supportsImageMIMEType(
const WebKit::WebString&);
virtual WebKit::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType(