diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 21:22:18 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 21:22:18 +0000 |
commit | 2306bbd5843b30f4e78a9342b60d580dce083794 (patch) | |
tree | 0da65f6a47df5daa1faa250a7a3452baccd77425 | |
parent | 71a73db160f40d649dd7e63dead998da5b006176 (diff) | |
download | chromium_src-2306bbd5843b30f4e78a9342b60d580dce083794.zip chromium_src-2306bbd5843b30f4e78a9342b60d580dce083794.tar.gz chromium_src-2306bbd5843b30f4e78a9342b60d580dce083794.tar.bz2 |
fix memory_test crashes
Memory tests run with plugins disabled. WebKit r39969 changed
Page::pluginData to return null in this case, so we need to check
for this null.
This still won't work until we rev our webkit to r39988 which fixes
another crash.
Review URL: http://codereview.chromium.org/18375
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8320 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/webframeloaderclient_impl.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc index 7d45a6d..3bd996b 100644 --- a/webkit/glue/webframeloaderclient_impl.cc +++ b/webkit/glue/webframeloaderclient_impl.cc @@ -1173,10 +1173,13 @@ bool WebFrameLoaderClient::canShowMIMEType(const String& mime_type) const { webkit_glue::CStringToStdString(mime_type.latin1()))) return true; + // If Chrome is started with the --disable-plugins switch, pluginData is null. + WebCore::PluginData* plugin_data = webframe_->frame()->page()->pluginData(); + // See if the type is handled by an installed plugin, if so, we can show it. // TODO(beng): (http://b/1085524) This is the place to stick a preference to // disable full page plugins (optionally for certain types!) - return webframe_->frame()->page()->pluginData()->supportsMimeType(mime_type); + return plugin_data && plugin_data->supportsMimeType(mime_type); } bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLScheme) const { @@ -1470,7 +1473,9 @@ ObjectContentType WebFrameLoaderClient::objectContentType( if (MIMETypeRegistry::isSupportedImageMIMEType(mime_type)) return ObjectContentImage; - if (webframe_->frame()->page()->pluginData()->supportsMimeType(mime_type)) + // If Chrome is started with the --disable-plugins switch, pluginData is null. + PluginData* plugin_data = webframe_->frame()->page()->pluginData(); + if (plugin_data && plugin_data->supportsMimeType(mime_type)) return ObjectContentNetscapePlugin; if (MIMETypeRegistry::isSupportedNonImageMIMEType(mime_type)) |