diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 21:01:47 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 21:01:47 +0000 |
commit | f5cdaff1456dfd7a5ad2240115285010a32f7fc1 (patch) | |
tree | 924c291f7e8f97faeb3bf2db3973d17d7e08da9d | |
parent | 1eae973272945a9d601f8cb2e54d7417a714d41d (diff) | |
download | chromium_src-f5cdaff1456dfd7a5ad2240115285010a32f7fc1.zip chromium_src-f5cdaff1456dfd7a5ad2240115285010a32f7fc1.tar.gz chromium_src-f5cdaff1456dfd7a5ad2240115285010a32f7fc1.tar.bz2 |
Lookup the plugin for the mime type before attempting to open a channel for the plugin. This ensures that the plugin will always be instantiated with the correct mime type at all times.
Added plugin tests to cover this case where in the embed tag is specified with a URL but without a mime type.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=8973
Bug=8973
Test :- Added a plugin test for this case.
Review URL: http://codereview.chromium.org/113326
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16414 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/render_view.cc | 28 | ||||
-rw-r--r-- | chrome/test/plugin/plugin_test.cpp | 6 | ||||
-rw-r--r-- | webkit/glue/webframeloaderclient_impl.cc | 3 |
3 files changed, 19 insertions, 18 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index a8f8b5a..dc7e284 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -1844,21 +1844,21 @@ WebPluginDelegate* RenderView::CreatePluginDelegate( if (!PluginChannelHost::IsListening()) return NULL; + FilePath path; + render_thread_->Send( + new ViewHostMsg_GetPluginPath(url, mime_type, clsid, &path, + actual_mime_type)); + if (path.value().empty()) + return NULL; + + std::string mime_type_to_use; + if (!actual_mime_type->empty()) + mime_type_to_use = *actual_mime_type; + else + mime_type_to_use = mime_type; + #if !defined(OS_LINUX) // In-proc plugins aren't supported on Linux. if (RenderProcess::current()->in_process_plugins()) { - FilePath path; - render_thread_->Send( - new ViewHostMsg_GetPluginPath(url, mime_type, clsid, &path, - actual_mime_type)); - if (path.value().empty()) - return NULL; - - std::string mime_type_to_use; - if (actual_mime_type && !actual_mime_type->empty()) - mime_type_to_use = *actual_mime_type; - else - mime_type_to_use = mime_type; - return WebPluginDelegate::Create(path, mime_type_to_use, gfx::NativeViewFromId(host_window_)); @@ -1866,7 +1866,7 @@ WebPluginDelegate* RenderView::CreatePluginDelegate( #endif WebPluginDelegateProxy* proxy = - WebPluginDelegateProxy::Create(url, mime_type, clsid, this); + WebPluginDelegateProxy::Create(url, mime_type_to_use, clsid, this); if (!proxy) return NULL; diff --git a/chrome/test/plugin/plugin_test.cpp b/chrome/test/plugin/plugin_test.cpp index babf0bd..0faf2ca 100644 --- a/chrome/test/plugin/plugin_test.cpp +++ b/chrome/test/plugin/plugin_test.cpp @@ -221,6 +221,10 @@ TEST_F(ActiveXTest, WMP) { TestActiveX(L"activex_wmp.html", kLongWaitTimeout, false); } +TEST_F(ActiveXTest, WMPNoEmbedMimeType) { + TestActiveX(L"activex_wmp_no_embed_mime_type.html", kLongWaitTimeout, false); +} + TEST_F(ActiveXTest, DISABLED_CustomScripting) { TestActiveX(L"activex_custom_scripting.html", kShortWaitTimeout, true); } @@ -229,7 +233,7 @@ TEST_F(ActiveXTest, DISABLED_EmbeddedMP3) { TestActiveX(L"mp3_test.html", kLongWaitTimeout, false); } -TEST_F(ActiveXTest, EmbeddedMPE) { +TEST_F(ActiveXTest, DISABLED_EmbeddedMPE) { TestActiveX(L"mpe_test.html", kLongWaitTimeout, false); } diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc index 5e22435..a1bed38 100644 --- a/webkit/glue/webframeloaderclient_impl.cc +++ b/webkit/glue/webframeloaderclient_impl.cc @@ -1472,9 +1472,6 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, // TODO(erikkay) // Attempt to map this clsid to a known NPAPI mime type if possible, failing // which we attempt to load the activex shim for the clsid. if (!activex_shim::GetMimeTypeForClsid(clsid, &my_mime_type)) { - // We only allowed specific ActiveX controls to run from certain websites. - if (!activex_shim::IsActiveXAllowed(clsid, url)) - return NULL; // We need to pass the combined clsid + version to PluginsList, so that it // would detect if the requested version is installed. If not, it needs // to use the default plugin to update the control. |