diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 05:53:23 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 05:53:23 +0000 |
commit | 8a3b796aa8160ddaed478224050a2b7e1b16d9e6 (patch) | |
tree | d23ba1b25c4bcbd425522268951ad8af4a7cc1c7 /chrome/plugin | |
parent | 79dbc66fba17d6b4967fe86a577b11d15548cdec (diff) | |
download | chromium_src-8a3b796aa8160ddaed478224050a2b7e1b16d9e6.zip chromium_src-8a3b796aa8160ddaed478224050a2b7e1b16d9e6.tar.gz chromium_src-8a3b796aa8160ddaed478224050a2b7e1b16d9e6.tar.bz2 |
This changelist fixes some issues with the NPAPI WMP plugin work in Chrome. The first is that we need to disable windowless mode since it doesn't work in the NPAPI plugin (Safari does this as well, and sites don't use windowless for Firefox). The second is to make UpdateGeometry message synchronous for WMP. The problem I saw was that while handling that message, the plugin might disaptch a NPObject Invoke method to play a video, which WMP doesn't expect and it leads to the video never playing.
While touching these files, I made some small cleanup by reverting the change that made WebPluginProxy not have a WebPluginDelegateImpl pointer, which added a bunch of unnecessary methods to WebPluginDelegate.
BUG=20259
TEST=use --no-activex and try playing the videos on http://www.nana10.co.il/Section/?SectionID=10847&sid=235
Review URL: http://codereview.chromium.org/196012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.cc | 39 | ||||
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.h | 12 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 4 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.h | 8 |
4 files changed, 22 insertions, 41 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc index 65bdfdc..cf2c689 100644 --- a/chrome/plugin/webplugin_delegate_stub.cc +++ b/chrome/plugin/webplugin_delegate_stub.cc @@ -20,18 +20,17 @@ #include "skia/ext/platform_device.h" #include "webkit/api/public/WebBindings.h" #include "webkit/api/public/WebCursorInfo.h" +#include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/glue/webcursor.h" -#include "webkit/glue/webplugin_delegate.h" using WebKit::WebBindings; using WebKit::WebCursorInfo; using webkit_glue::WebPlugin; -using webkit_glue::WebPluginDelegate; using webkit_glue::WebPluginResourceClient; class FinishDestructionTask : public Task { public: - FinishDestructionTask(WebPluginDelegate* delegate, WebPlugin* webplugin) + FinishDestructionTask(WebPluginDelegateImpl* delegate, WebPlugin* webplugin) : delegate_(delegate), webplugin_(webplugin) { } void Run() { @@ -43,7 +42,7 @@ class FinishDestructionTask : public Task { } private: - WebPluginDelegate* delegate_; + WebPluginDelegateImpl* delegate_; WebPlugin* webplugin_; }; @@ -99,6 +98,7 @@ void WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(PluginMsg_GetPluginScriptableObject, OnGetPluginScriptableObject) IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometry, OnUpdateGeometry) + IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometrySync, OnUpdateGeometry) IPC_MESSAGE_HANDLER(PluginMsg_SendJavaScriptStream, OnSendJavaScriptStream) IPC_MESSAGE_HANDLER(PluginMsg_DidReceiveManualResponse, @@ -126,19 +126,11 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params, child_process_logging::ScopedActiveURLSetter url_setter(page_url_); *result = false; - int argc = static_cast<int>(params.arg_names.size()); - if (argc != static_cast<int>(params.arg_values.size())) { + if (params.arg_names.size() != params.arg_values.size()) { NOTREACHED(); return; } - char **argn = new char*[argc]; - char **argv = new char*[argc]; - for (int i = 0; i < argc; ++i) { - argn[i] = const_cast<char*>(params.arg_names[i].c_str()); - argv[i] = const_cast<char*>(params.arg_values[i].c_str()); - } - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); FilePath path = FilePath::FromWStringHack( command_line.GetSwitchValue(switches::kPluginPath)); @@ -162,15 +154,15 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params, return; #endif - delegate_ = WebPluginDelegate::Create(path, mime_type_, parent); + delegate_ = WebPluginDelegateImpl::Create(path, mime_type_, parent); if (delegate_) { webplugin_->set_delegate(delegate_); - *result = delegate_->Initialize( - params.url, argn, argv, argc, webplugin_, params.load_manually); + *result = delegate_->Initialize(params.url, + params.arg_names, + params.arg_values, + webplugin_, + params.load_manually); } - - delete[] argn; - delete[] argv; } void WebPluginDelegateStub::OnWillSendRequest(int id, const GURL& url) { @@ -278,13 +270,10 @@ void WebPluginDelegateStub::OnPrint(base::SharedMemoryHandle* shared_memory, } void WebPluginDelegateStub::OnUpdateGeometry( - const gfx::Rect& window_rect, - const gfx::Rect& clip_rect, - const TransportDIB::Handle& windowless_buffer, - const TransportDIB::Handle& background_buffer) { + const PluginMsg_UpdateGeometry_Param& param) { webplugin_->UpdateGeometry( - window_rect, clip_rect, - windowless_buffer, background_buffer); + param.window_rect, param.clip_rect, + param.windowless_buffer, param.background_buffer); } void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id, diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h index 34cde08..9ad63d20 100644 --- a/chrome/plugin/webplugin_delegate_stub.h +++ b/chrome/plugin/webplugin_delegate_stub.h @@ -20,6 +20,7 @@ class PluginChannel; class WebPluginProxy; struct PluginMsg_Init_Params; struct PluginMsg_DidReceiveResponseParams; +struct PluginMsg_UpdateGeometry_Param; struct PluginMsg_URLRequestReply_Params; class WebCursor; @@ -27,9 +28,7 @@ namespace WebKit { class WebInputEvent; } -namespace webkit_glue { -class WebPluginDelegate; -} +class WebPluginDelegateImpl; // Converts the IPC messages from WebPluginDelegateProxy into calls to the // actual WebPluginDelegate object. @@ -72,10 +71,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, void OnPrint(base::SharedMemoryHandle* shared_memory, size_t* size); - void OnUpdateGeometry(const gfx::Rect& window_rect, - const gfx::Rect& clip_rect, - const TransportDIB::Handle& windowless_buffer, - const TransportDIB::Handle& background_buffer); + void OnUpdateGeometry(const PluginMsg_UpdateGeometry_Param& param); void OnGetPluginScriptableObject(int* route_id, intptr_t* npobject_ptr); void OnSendJavaScriptStream(const GURL& url, const std::string& result, @@ -102,7 +98,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, scoped_refptr<PluginChannel> channel_; - webkit_glue::WebPluginDelegate* delegate_; + WebPluginDelegateImpl* delegate_; WebPluginProxy* webplugin_; // The url of the main frame hosting the plugin. diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index f2f5090..721a39e 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -30,14 +30,12 @@ #include "skia/ext/platform_device.h" #include "webkit/api/public/WebBindings.h" #include "webkit/glue/plugins/webplugin_delegate_impl.h" -#include "webkit/glue/webplugin_delegate.h" #if defined(OS_WIN) #include "base/gfx/gdi_util.h" #endif using WebKit::WebBindings; -using webkit_glue::WebPluginDelegate; using webkit_glue::WebPluginResourceClient; typedef std::map<CPBrowsingContext, WebPluginProxy*> ContextMap; @@ -310,7 +308,7 @@ void WebPluginProxy::HandleURLRequest(const char *method, // Please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=366082 // for more details on this. if (delegate_->GetQuirks() & - WebPluginDelegate::PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { + WebPluginDelegateImpl::PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { GURL request_url(url); if (!request_url.SchemeIs(chrome::kHttpScheme) && !request_url.SchemeIs(chrome::kHttpsScheme) && diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index 6297f24..62b01ef 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -28,9 +28,7 @@ namespace base { class WaitableEvent; } -namespace webkit_glue { -class WebPluginDelegate; -} +class WebPluginDelegateImpl; // This is an implementation of WebPlugin that proxies all calls to the // renderer. @@ -43,7 +41,7 @@ class WebPluginProxy : public webkit_glue::WebPlugin { const GURL& page_url); ~WebPluginProxy(); - void set_delegate(webkit_glue::WebPluginDelegate* d) { delegate_ = d; } + void set_delegate(WebPluginDelegateImpl* d) { delegate_ = d; } // WebPlugin overrides void SetWindow(gfx::PluginWindowHandle window); @@ -165,7 +163,7 @@ class WebPluginProxy : public webkit_glue::WebPlugin { uint32 cp_browsing_context_; NPObject* window_npobject_; NPObject* plugin_element_; - webkit_glue::WebPluginDelegate* delegate_; + WebPluginDelegateImpl* delegate_; gfx::Rect damaged_rect_; bool waiting_for_paint_; scoped_ptr<base::WaitableEvent> modal_dialog_event_; |