diff options
-rw-r--r-- | chrome/plugin/npobject_stub.cc | 31 | ||||
-rw-r--r-- | chrome/plugin/npobject_stub.h | 2 | ||||
-rw-r--r-- | chrome/plugin/plugin_thread.h | 2 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_constants_win.h | 10 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list_win.cc | 5 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_win.cc | 17 |
6 files changed, 48 insertions, 19 deletions
diff --git a/chrome/plugin/npobject_stub.cc b/chrome/plugin/npobject_stub.cc index 7287f4c..a48049d 100644 --- a/chrome/plugin/npobject_stub.cc +++ b/chrome/plugin/npobject_stub.cc @@ -8,10 +8,12 @@ #include "chrome/common/plugin_messages.h" #include "chrome/plugin/npobject_util.h" #include "chrome/plugin/plugin_channel_base.h" +#include "chrome/plugin/plugin_thread.h" #include "chrome/renderer/webplugin_delegate_proxy.h" #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/npruntime.h" #include "webkit/api/public/WebBindings.h" +#include "webkit/glue/plugins/plugin_constants_win.h" using WebKit::WebBindings; @@ -68,7 +70,7 @@ void NPObjectStub::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Invoke, OnInvoke); IPC_MESSAGE_HANDLER(NPObjectMsg_HasProperty, OnHasProperty); IPC_MESSAGE_HANDLER(NPObjectMsg_GetProperty, OnGetProperty); - IPC_MESSAGE_HANDLER(NPObjectMsg_SetProperty, OnSetProperty); + IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_SetProperty, OnSetProperty); IPC_MESSAGE_HANDLER(NPObjectMsg_RemoveProperty, OnRemoveProperty); IPC_MESSAGE_HANDLER(NPObjectMsg_Invalidate, OnInvalidate); IPC_MESSAGE_HANDLER(NPObjectMsg_Enumeration, OnEnumeration); @@ -205,7 +207,8 @@ void NPObjectStub::OnGetProperty(const NPIdentifier_Param& name, void NPObjectStub::OnSetProperty(const NPIdentifier_Param& name, const NPVariant_Param& property, - bool* result) { + IPC::Message* reply_msg) { + bool result; NPVariant result_var; VOID_TO_NPVARIANT(result_var); NPIdentifier id = CreateNPIdentifier(name); @@ -215,15 +218,33 @@ void NPObjectStub::OnSetProperty(const NPIdentifier_Param& name, if (IsPluginProcess()) { if (npobject_->_class->setProperty) { - *result = npobject_->_class->setProperty(npobject_, id, &property_var); +#if defined(OS_WIN) + static std::wstring filename = StringToLowerASCII( + PluginThread::current()->plugin_path().BaseName().value()); + static NPIdentifier fullscreen = + WebBindings::getStringIdentifier("fullScreen"); + if (filename == kNewWMPPlugin && id == fullscreen) { + // Workaround for bug 15985, which is if Flash causes WMP to go + // full screen a deadlock can occur when WMP calls SetFocus. + NPObjectMsg_SetProperty::WriteReplyParams(reply_msg, true); + Send(reply_msg); + reply_msg = NULL; + } +#endif + result = npobject_->_class->setProperty(npobject_, id, &property_var); } else { - *result = false; + result = false; } } else { - *result = WebBindings::setProperty(0, npobject_, id, &property_var); + result = WebBindings::setProperty(0, npobject_, id, &property_var); } WebBindings::releaseVariantValue(&property_var); + + if (reply_msg) { + NPObjectMsg_SetProperty::WriteReplyParams(reply_msg, result); + Send(reply_msg); + } } void NPObjectStub::OnRemoveProperty(const NPIdentifier_Param& name, diff --git a/chrome/plugin/npobject_stub.h b/chrome/plugin/npobject_stub.h index da0745c..0f59290 100644 --- a/chrome/plugin/npobject_stub.h +++ b/chrome/plugin/npobject_stub.h @@ -68,7 +68,7 @@ class NPObjectStub : public IPC::Channel::Listener, bool* result); void OnSetProperty(const NPIdentifier_Param& name, const NPVariant_Param& property, - bool* result); + IPC::Message* reply_msg); void OnRemoveProperty(const NPIdentifier_Param& name, bool* result); void OnInvalidate(); diff --git a/chrome/plugin/plugin_thread.h b/chrome/plugin/plugin_thread.h index cc0e7f6..c6f05ba 100644 --- a/chrome/plugin/plugin_thread.h +++ b/chrome/plugin/plugin_thread.h @@ -27,6 +27,8 @@ class PluginThread : public ChildThread { // Returns the one plugin thread. static PluginThread* current(); + FilePath plugin_path() { return plugin_path_; } + private: virtual void OnControlMessageReceived(const IPC::Message& msg); diff --git a/webkit/glue/plugins/plugin_constants_win.h b/webkit/glue/plugins/plugin_constants_win.h index 6bc2945..f00886d 100644 --- a/webkit/glue/plugins/plugin_constants_win.h +++ b/webkit/glue/plugins/plugin_constants_win.h @@ -24,4 +24,14 @@ // The name of the registry key which NPAPI plugins update on installation. #define kRegistryMozillaPlugins L"SOFTWARE\\MozillaPlugins" +#define kMozillaActiveXPlugin L"npmozax.dll" +#define kNewWMPPlugin L"np-mswmp.dll" +#define kOldWMPPlugin L"npdsplay.dll" +#define kYahooApplicationStatePlugin L"npystate.dll" +#define kWanWangProtocolHandlerPlugin L"npww.dll" +#define kFlashPlugin L"npswf32.dll" +#define kAcrobatReaderPlugin L"nppdf32.dll" +#define kRealPlayerPlugin L"nppl3260.dll" +#define kSilverlightPlugin L"npctrl.dll" + #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_LIST_H_ diff --git a/webkit/glue/plugins/plugin_list_win.cc b/webkit/glue/plugins/plugin_list_win.cc index b26e9ad..9873691 100644 --- a/webkit/glue/plugins/plugin_list_win.cc +++ b/webkit/glue/plugins/plugin_list_win.cc @@ -27,11 +27,6 @@ const TCHAR kRegistryQuickTime[] = _T("QuickTimePlayer.exe"); const TCHAR kRegistryPath[] = _T("Path"); const TCHAR kRegistryFirefoxInstalled[] = _T("SOFTWARE\\Mozilla\\Mozilla Firefox"); -const TCHAR kMozillaActiveXPlugin[] = _T("npmozax.dll"); -const TCHAR kNewWMPPlugin[] = _T("np-mswmp.dll"); -const TCHAR kOldWMPPlugin[] = _T("npdsplay.dll"); -const TCHAR kYahooApplicationStatePlugin[] = _T("npystate.dll"); -const TCHAR kWanWangProtocolHandlerPlugin[] = _T("npww.dll"); const TCHAR kRegistryJava[] = _T("Software\\JavaSoft\\Java Runtime Environment"); const TCHAR kRegistryBrowserJavaVersion[] = _T("BrowserJavaVersion"); diff --git a/webkit/glue/plugins/webplugin_delegate_impl_win.cc b/webkit/glue/plugins/webplugin_delegate_impl_win.cc index 64b0805..1f13cf8 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_win.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_win.cc @@ -250,17 +250,16 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( memset(&window_, 0, sizeof(window_)); const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info(); - std::string filename = - WideToUTF8(StringToLowerASCII(plugin_info.path.BaseName().value())); + std::wstring filename = StringToLowerASCII(plugin_info.path.BaseName().value()); if (instance_->mime_type() == "application/x-shockwave-flash" || - filename == "npswf32.dll") { + filename == kFlashPlugin) { // Flash only requests windowless plugins if we return a Mozilla user // agent. instance_->set_use_mozilla_user_agent(); quirks_ |= PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE; quirks_ |= PLUGIN_QUIRK_PATCH_SETCURSOR; - } else if (filename == "nppdf32.dll") { + } else if (filename == kAcrobatReaderPlugin) { // Check for the version number above or equal 9. std::vector<std::wstring> version; SplitString(plugin_info.version, L'.', &version); @@ -279,10 +278,12 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( // Windowless mode doesn't work in the WMP NPAPI plugin. quirks_ |= PLUGIN_QUIRK_NO_WINDOWLESS; - // Non-admin users on XP couldn't modify the key to force the new UI. - quirks_ |= PLUGIN_QUIRK_PATCH_REGENUMKEYEXW; + if (filename == kOldWMPPlugin) { + // Non-admin users on XP couldn't modify the key to force the new UI. + quirks_ |= PLUGIN_QUIRK_PATCH_REGENUMKEYEXW; + } } else if (instance_->mime_type() == "audio/x-pn-realaudio-plugin" || - filename == "nppl3260.dll") { + filename == kRealPlayerPlugin) { quirks_ |= PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY; } else if (plugin_info.name.find(L"VLC Multimedia Plugin") != std::wstring::npos || @@ -293,7 +294,7 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( quirks_ |= PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY; // VLC 0.8.6d and 0.8.6e crash if multiple instances are created. quirks_ |= PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES; - } else if (filename == "npctrl.dll") { // Silverlight + } else if (filename == kSilverlightPlugin) { // Explanation for this quirk can be found in // WebPluginDelegateImpl::Initialize. quirks_ |= PLUGIN_QUIRK_PATCH_SETCURSOR; |